コード例 #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);
     }
 }
コード例 #2
0
 private static void SetBehavior(DependencyObject obj, ListItemMoveBehavior value)
 {
     obj.SetValue(BehaviorProperty, value);
 }