private void SetOwnerItem(Control control) { if (control == null) { return; } if (control is Popup) { Popup popupControl = control as Popup; ownerPopup = popupControl; ownerPopup.childPopup = this; OwnerItem = popupControl.Items[0]; return; } if (control.Parent != null) { SetOwnerItem(control.Parent); } }
private void SetOwnerItem(Control control) { if (control == null) return; if (control is Popup) { var popupControl = control as Popup; _ownerPopup = popupControl; _ownerPopup._childPopup = this; OwnerItem = popupControl.Items[0]; return; } if (control.Parent != null) SetOwnerItem(control.Parent); }