Beispiel #1
0
 private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     if ((bool)e.NewValue)
     {
         var element  = (ItemsControl)d;
         var behavior = new ListItemMoveBehavior(element);
         SetBehavior(element, behavior);
     }
     else
     {
         GetBehavior(d).Dispose();
         d.ClearValue(BehaviorProperty);
     }
 }
Beispiel #2
0
 private static void SetBehavior(DependencyObject obj, ListItemMoveBehavior value)
 {
     obj.SetValue(BehaviorProperty, value);
 }