示例#1
0
 private static void OnSetCommandParameterCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
 {
     Controls.LoadingListBox ctrl = dependencyObject as Controls.LoadingListBox;
     if (ctrl != null)
     {
         NeedItemsCommandBehavior behavior = GetOrCreateBehavior(ctrl);
         behavior.CommandParameter = e.NewValue;
     }
 }
示例#2
0
        private static NeedItemsCommandBehavior GetOrCreateBehavior(Controls.LoadingListBox ctrl)
        {
            NeedItemsCommandBehavior behavior = ctrl.GetValue(NeedItemsCommandBehaviorProperty) as NeedItemsCommandBehavior;

            if (behavior == null)
            {
                behavior = new NeedItemsCommandBehavior(ctrl);
                ctrl.SetValue(NeedItemsCommandBehaviorProperty, behavior);
            }

            return(behavior);
        }
示例#3
0
 public static object GetCommandParameter(Controls.LoadingListBox ctrl)
 {
     return(ctrl.GetValue(CommandParameterProperty));
 }
示例#4
0
 public static void SetCommandParameter(Controls.LoadingListBox ctrl, object parameter)
 {
     ctrl.SetValue(CommandParameterProperty, parameter);
 }
示例#5
0
 public static ICommand GetCommand(Controls.LoadingListBox ctrl)
 {
     return(ctrl.GetValue(CommandProperty) as ICommand);
 }
示例#6
0
 public static void SetCommand(Controls.LoadingListBox ctrl, ICommand command)
 {
     ctrl.SetValue(CommandProperty, command);
 }