Example #1
0
        private static void CommandProperty_Changed(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            Selector element = dependencyObject as Selector;

            if (element != null)
            {
                MultiSelectionChangedBehavior behavior = GetOrCreateBehavior(element);
                behavior.Command = e.NewValue as ICommand;
            }
        }
Example #2
0
        private static MultiSelectionChangedBehavior GetOrCreateBehavior(Selector element)
        {
            MultiSelectionChangedBehavior behavior = element.GetValue(MultiSelectionChangedBehaviourProperty) as MultiSelectionChangedBehavior;

            if (behavior == null)
            {
                behavior = new MultiSelectionChangedBehavior(element);
                element.SetValue(MultiSelectionChangedBehaviourProperty, behavior);
            }

            return(behavior);
        }
Example #3
0
 public static void SetMultiSelectionChangedCommandBehavior(DependencyObject obj,
                                                            MultiSelectionChangedBehavior value)
 {
     obj.SetValue(MultiSelectionChangedBehaviourProperty, value);
 }