예제 #1
0
        /// <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);
            }
        }
예제 #2
0
        /// <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;
            }
        }