This abstract class is a RoutedCommand which allows its subclasses to provide default logic for determining if they can execute and how to execute. To enable the default logic to be used, set the IsCommandSink attached property to true on the root element of the element tree which uses one or more SmartRoutedCommand subclasses.
Documentation: http://www.codeproject.com/KB/WPF/SmartRoutedCommandsInWPF.aspx
Наследование: System.Windows.Input.RoutedCommand
Пример #1
0
        static void OnCanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            SmartRoutedCommand cmd = e.Command as SmartRoutedCommand;

            if (cmd != null)
            {
                e.CanExecute = cmd.CanExecuteCore(e.Parameter);
            }
        }
Пример #2
0
        static void OnExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            SmartRoutedCommand cmd = e.Command as SmartRoutedCommand;

            if (cmd != null)
            {
                cmd.ExecuteCore(e.Parameter);
                e.Handled = true;
            }
        }