private static void OnSetCommandParameterCallback (DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { GridDataControl control = dependencyObject as GridDataControl; if (control != null) { GridQueryCellStyleInfoBehavior behavior = GetOrCreateBehavior(control); behavior.CommandParameter = e.NewValue; } }
private static GridQueryCellStyleInfoBehavior GetOrCreateBehavior(GridDataControl control) { GridQueryCellStyleInfoBehavior behavior = control.GetValue(GridQueryCellStyleInfoBehaviorProperty) as GridQueryCellStyleInfoBehavior; if (behavior == null) { behavior = new GridQueryCellStyleInfoBehavior(control); control.SetValue(GridQueryCellStyleInfoBehaviorProperty, behavior); } return(behavior); }