Esempio n. 1
0
 public ExpandableMenuItemViewModel(string text, IEnumerable <MenuItemViewModelBase> subItems = null,
                                    string description = null, Mdl2Icon icon = null) : base(text, description, icon)
 {
     if (subItems == null)
     {
         SubItems = new ObservableCollection <MenuItemViewModelBase>();
     }
     else if (subItems is ObservableCollection <MenuItemViewModelBase> observableSubItems)
     {
         SubItems = observableSubItems;
     }
     else
     {
         SubItems = new ObservableCollection <MenuItemViewModelBase>(subItems);
     }
 }
 public ToggleMenuItemViewModel(string text, object bindingSource, string bindingPath = null, string description = null, Mdl2Icon icon = null)
     : base(text, description, icon)
 {
     BindingSource = bindingSource ?? throw new ArgumentNullException(nameof(bindingSource));
     BindingPath   = bindingPath;
 }
 public RadioMenuItemViewModel(string text, string groupName, object bindingSource, string bindingPath = null, string description = null, Mdl2Icon icon = null)
     : base(text, description, icon)
 {
     GroupName     = groupName ?? throw new ArgumentNullException(nameof(groupName));
     BindingSource = bindingSource ?? throw new ArgumentNullException(nameof(bindingSource));
     BindingPath   = bindingPath;
 }