Example #1
0
 public static void OnDropDownControlChanged <T>(T owner, PopupControlBase oldControl, PopupControlBase newControl) where T : FrameworkElement, IDropDownControlHost
 {
     if (owner.PopupHost == null)
     {
         SetOwnerLogicalChild(owner, newControl);
     }
     else
     {
         owner.PopupHost.DropDownControl = newControl;
     }
 }
Example #2
0
        private static void SetOwnerLogicalChild <T>(T owner, PopupControlBase dropDownControl) where T : FrameworkElement, IDropDownControlHost
        {
            var depObj = dropDownControl as DependencyObject;

            owner.LogicalChild = depObj?.GetLogicalParent() == null ? dropDownControl : null;
        }