private void Window_CommandSaved(object sender, CommandModelBase command) { if (command != null) { CommandActionEditorControlViewModel viewModel = (CommandActionEditorControlViewModel)this.DataContext; if (viewModel != null) { viewModel.SelectedCommandType = command.Type; viewModel.SelectedCommand = command; } } }
private async void EditCommandButton_Click(object sender, System.Windows.RoutedEventArgs e) { CommandActionEditorControlViewModel viewModel = (CommandActionEditorControlViewModel)this.DataContext; if (viewModel != null && viewModel.SelectedCommand != null) { if (viewModel.SelectedCommand.Type == CommandTypeEnum.PreMade || viewModel.SelectedCommand.Type == CommandTypeEnum.Game) { await DialogHelper.ShowMessage(MixItUp.Base.Resources.CommandCannotBeEditedHere); } else { CommandEditorWindow window = CommandEditorWindow.GetCommandEditorWindow(viewModel.SelectedCommand); window.ForceShow(); } } }