Exemple #1
0
        private void OperationItemBorder_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            ButtonToolsMenu.ContextMenu.IsOpen = false;
            e.Handled = true;
            dynamic x = sender;

            System.Windows.Input.ICommand perform = x.DataContext.Perform;
            perform.Execute(null);
        }
Exemple #2
0
 public void Execute(object parameter)
 {
     if (first.CanExecute(parameter))
     {
         first.Execute(parameter);
     }
     else
     {
         second.Execute(parameter);
     }
 }
Exemple #3
0
        internal static bool Execute(object sender, System.Windows.Input.ICommand command, object commandParameter)
        {
            if (command != null)
            {
                RoutedCommand routedCommand = command as RoutedCommand;
                IInputElement inputElement  = sender as IInputElement;
                if (routedCommand != null && routedCommand.CanExecute(commandParameter, inputElement))
                {
                    routedCommand.Execute(commandParameter, inputElement);
                    return(true);
                }
                else if (command.CanExecute(commandParameter))
                {
                    command.Execute(commandParameter);
                    return(true);
                }
            }

            return(false);
        }
Exemple #4
0
        private void RaiseCommandExecute()
        {
            System.Windows.Input.ICommand command = this.Command;
            if (command != null)
            {
                object parameter = this.ReadLocalValue(RadRating.CommandParameterProperty);
                if (parameter == DependencyProperty.UnsetValue)
                {
                    parameter = this.Value;
                }
                else
                {
                    parameter = this.GetValue(RadRating.CommandParameterProperty);
                }

                if (command.CanExecute(parameter))
                {
                    command.Execute(parameter);
                }
            }
        }
Exemple #5
0
 public void Execute(object parameter)
 {
     AnalyticsMonitorService.TrackFeature(featureName, "Shortcut");
     baseCommand.Execute(parameter);
 }
Exemple #6
0
 public void Execute(object parameter)
 {
     ServiceSingleton.GetRequiredService <IAnalyticsMonitor>().TrackFeature(featureName, "Shortcut");
     baseCommand.Execute(parameter);
 }
 protected override void OnMouseUp(MouseButtonEventArgs e)
 {
     Click?.Execute(this);
 }
Exemple #8
0
 public void Execute(object parameter)
 {
     baseCommand.Execute(parameter);
 }