Exemple #1
0
 private static void OnSetCommandParameterCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
 {
     System.Windows.Controls.ListView element = dependencyObject as System.Windows.Controls.ListView;
     if (element != null)
     {
         EscapeReleaseBehavior behavior = GetOrCreateBehavior(element);
         behavior.CommandParameter = e.NewValue;
     }
 }
Exemple #2
0
        private static EscapeReleaseBehavior GetOrCreateBehavior(System.Windows.Controls.ListView element)
        {
            EscapeReleaseBehavior behavior = element.GetValue(EscapeReleaseBehaviorProperty) as EscapeReleaseBehavior;

            if (behavior == null)
            {
                behavior = new EscapeReleaseBehavior(element);
                element.SetValue(EscapeReleaseBehaviorProperty, behavior);
            }
            return(behavior);
        }
Exemple #3
0
 public static void SetEscapeReleaseBehavior(DependencyObject obj, EscapeReleaseBehavior value)
 {
     obj.SetValue(EscapeReleaseBehaviorProperty, value);
 }