protected OnPreviewCanExecute ( object sender, System.Windows.Input.CanExecuteRoutedEventArgs e ) : void | ||
sender | object | The command target on which the command is executing. |
e | System.Windows.Input.CanExecuteRoutedEventArgs | The event data. |
리턴 | void |
protected internal override void OnPreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
var target = GetDataContext(sender);
bool canExecute;
if (!CommandExecutionManager.TryExecuteCommand(target, e.Parameter, false,
PreviewExecuted, PreviewCanExecute, out canExecute))
{
return;
}
e.CanExecute = canExecute;
e.Handled = true;
}