Beispiel #1
0
 private IOptionWrapper WrapSimpleOption(UserControlWrapper menuItem, ContentControl control)
 {
     if (control == null)
     {
         throw new ArgumentNullException(nameof(control));
     }
     if (control is CheckBox checkBox)
     {
         return(new CheckBoxWrapper(menuItem, checkBox));
     }
     throw new ArgumentException("Argument must be a wrappable option type.", nameof(control));
 }
Beispiel #2
0
 private IOptionWrapper WrapOption(UserControlWrapper menuItem, DependencyObject depObj)
 {
     if (depObj is DockPanel dockPanel)
     {
         foreach (var child in dockPanel.Children)
         {
             if (child is CheckBox)
             {
                 return(WrapSimpleOption(menuItem, child as CheckBox));
             }
         }
     }
     return(WrapSimpleOption(menuItem, depObj as ContentControl));
 }
Beispiel #3
0
 public CheckBoxWrapper(UserControlWrapper menuItem, CheckBox checkBox) : base(menuItem, checkBox)
 {
 }
Beispiel #4
0
 protected OptionWrapper(UserControlWrapper menuItem, T control)
 {
     MenuItem = menuItem;
     Control  = control;
 }