private static void OnSetCommandParameterCallback (DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { GridDataControl control = dependencyObject as GridDataControl; if (control != null) { GridItemsSourceChangedBehavior behavior = GetOrCreateBehavior(control); behavior.CommandParameter = e.NewValue; } }
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); }