/// <summary> /// Event handler, called when CanExecute changes. /// </summary> /// <param name="sender">the changing object</param> /// <param name="e">the event's arguments</param> private static void OnCanExecute(object sender, CanExecuteRoutedEventArgs e) { SmartRoutedUICommand cmd = e.Command as SmartRoutedUICommand; if (cmd != null) { e.CanExecute = cmd.CanExecuteCore(e.Parameter); } }
/// <summary> /// Event handler, called when Executed changes. /// </summary> /// <param name="sender">the changing object</param> /// <param name="e">the event's arguments</param> private static void OnExecuted(object sender, ExecutedRoutedEventArgs e) { SmartRoutedUICommand cmd = e.Command as SmartRoutedUICommand; if (cmd != null) { cmd.ExecuteCore(e.Parameter); e.Handled = true; } }