private static XamDataTreeCommandBehavior GetOrCreateCommandBehavior(XamDataTree menuItem) { if (!(menuItem.GetValue(SelectedCommandBehaviorProperty) is XamDataTreeCommandBehavior behavior)) { behavior = new XamDataTreeCommandBehavior(menuItem); menuItem.SetValue(SelectedCommandBehaviorProperty, behavior); } return(behavior); }
private static XamDataTreeNodeUnselectedCommandBehavior GetOrCreateBehavior(XamDataTree tree) { XamDataTreeNodeUnselectedCommandBehavior behavior = tree.GetValue(DataItemUnselectedProperty) as XamDataTreeNodeUnselectedCommandBehavior; if (behavior == null) { behavior = new XamDataTreeNodeUnselectedCommandBehavior(tree); tree.SetValue(DataItemUnselectedProperty, behavior); } return(behavior); }
private static XamDataTreeNodeActivatedCommandBehavior GetOrCreateBehavior(XamDataTree menuItem) { XamDataTreeNodeActivatedCommandBehavior behavior = menuItem.GetValue(SelectedCommandBehaviorProperty) as XamDataTreeNodeActivatedCommandBehavior; if (behavior == null) { behavior = new XamDataTreeNodeActivatedCommandBehavior(menuItem); menuItem.SetValue(SelectedCommandBehaviorProperty, behavior); } return(behavior); }
public static void SetDefaultSelectedDataItem(XamDataTree tree, object value) { tree.SetValue(DefaultSelectedDataItemProperty, value); }
public static void SetCommandProperty(XamDataTree menuItem, object parameter) { menuItem.SetValue(CommandParameterProperty, parameter); }
public static void SetCommand(XamDataTree menuItem, ICommand command) { menuItem.SetValue(CommandProperty, command); }
public static void SetCommandParameter(XamDataTree tree, object parameter) { tree.SetValue(CommandParameterProperty, parameter); }