Esempio n. 1
0
        private static void OnSetCommandParameterCallback
            (DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            GridDataControl control = dependencyObject as GridDataControl;

            if (control != null)
            {
                GridItemsSourceChangedBehavior behavior = GetOrCreateBehavior(control);
                behavior.CommandParameter = e.NewValue;
            }
        }
Esempio n. 2
0
        private static GridItemsSourceChangedBehavior GetOrCreateBehavior(GridDataControl control)
        {
            GridItemsSourceChangedBehavior behavior =
                control.GetValue(GridItemsSourceChangedBehaviorProperty) as GridItemsSourceChangedBehavior;

            if (behavior == null)
            {
                behavior = new GridItemsSourceChangedBehavior(control);
                control.SetValue(GridItemsSourceChangedBehaviorProperty, behavior);
            }
            return(behavior);
        }