private static XamDataTreeCommandBehavior GetOrCreateCommandBehavior(XamDataTree menuItem)
 {
     if (!(menuItem.GetValue(SelectedCommandBehaviorProperty) is XamDataTreeCommandBehavior behavior))
     {
         behavior = new XamDataTreeCommandBehavior(menuItem);
         menuItem.SetValue(SelectedCommandBehaviorProperty, behavior);
     }
     return(behavior);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 7
0
 public static void SetCommandParameter(XamDataTree tree, object parameter)
 {
     tree.SetValue(CommandParameterProperty, parameter);
 }