public bool CanExecute(GestureData data) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Context == null) { throw new ArgumentException(Resources.Error_MissingContext); } ToolCommandBinding commandBinding = this.GetCommandBinding(data); if (commandBinding == null) { return(false); } CanExecuteToolEventArgs e = new CanExecuteToolEventArgs((ICommand)this, (object)data); return(commandBinding.OnCanExecute(data.Context, e)); }
private ToolCommandBinding GetCommandBinding(GestureData data) { return(data.Context.Items.GetValue <Tool>().GetToolCommandBinding((ICommand)this, data)); }
private void OnUnionSelectObject(object sender, ExecutedToolEventArgs e) { Performance.StartTiming(PerformanceMarks.SelectionChange); SelectionOperations.Union(this.Context, GestureData.FromEventArgs(e).ImpliedSource); Performance.StopTiming(PerformanceMarks.SelectionChange); }