コード例 #1
0
ファイル: GridBehaviors.cs プロジェクト: dmonjeau/wpf-demos
        private static void OnSetCommandParameterCallback
            (DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            GridDataControl control = dependencyObject as GridDataControl;

            if (control != null)
            {
                GridItemsSourceChangedBehavior behavior = GetOrCreateBehavior(control);
                behavior.CommandParameter = e.NewValue;
            }
        }
コード例 #2
0
ファイル: GridBehaviors.cs プロジェクト: dmonjeau/wpf-demos
        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);
        }