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); }
public void Execute(object parameter) { if (first.CanExecute(parameter)) { first.Execute(parameter); } else { second.Execute(parameter); } }
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); }
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); } } }
public void Execute(object parameter) { AnalyticsMonitorService.TrackFeature(featureName, "Shortcut"); baseCommand.Execute(parameter); }
public void Execute(object parameter) { ServiceSingleton.GetRequiredService <IAnalyticsMonitor>().TrackFeature(featureName, "Shortcut"); baseCommand.Execute(parameter); }
protected override void OnMouseUp(MouseButtonEventArgs e) { Click?.Execute(this); }
public void Execute(object parameter) { baseCommand.Execute(parameter); }