private async void OnCommitCreateParameter() { if (!(SelectedEventParameter.Id == 0 && SelectedEventParameter.IsValid())) { MessageBox.Show("Error. Make sure that the new parameter is selected and that Property Name and Variable fields have values.", AppName, MessageBoxButton.OK, MessageBoxImage.Error); return; } MessageBoxResult messageBoxResult = MessageBox.Show("Proceed with creation? Click Cancel to continue editing or No to discard changes.", AppName, MessageBoxButton.YesNoCancel, MessageBoxImage.Question); if (messageBoxResult == MessageBoxResult.Cancel) { return; } else if (messageBoxResult == MessageBoxResult.No) { OnCancelCreateParameter(); } else { //Create Event Parameter if Yes string result = await _eventParameterService.CreateEventParameter(SelectedEvent.Id, SelectedEventParameter); MessageBox.Show(result, AppName, MessageBoxButton.OK, MessageBoxImage.Information); GetEventParameters(SelectedEvent.Id); } CreatingItem = false; CreateParameterCommand.RaiseCanExecuteChanged(); UpdateParameterCommand.RaiseCanExecuteChanged(); DeleteParameterCommand.RaiseCanExecuteChanged(); RefreshParametersCommand.RaiseCanExecuteChanged(); }
private void OnCancelCreateParameter() { GetEventParameters(SelectedEvent.Id); CreatingItem = false; CreateParameterCommand.RaiseCanExecuteChanged(); UpdateParameterCommand.RaiseCanExecuteChanged(); DeleteParameterCommand.RaiseCanExecuteChanged(); RefreshParametersCommand.RaiseCanExecuteChanged(); }
//Parameter commands private void OnCreateParameter() { //Adds a blank entry to the EventParameters collection EventParameter eventParameter = new EventParameter(); eventParameter.PropertyName = ""; eventParameter.MappedTo_Input_X = ""; eventParameter.WFProfileId = 0; EventParameters.Add(eventParameter); SelectedEventParameter = eventParameter; CreatingItem = true; CreateParameterCommand.RaiseCanExecuteChanged(); UpdateParameterCommand.RaiseCanExecuteChanged(); DeleteParameterCommand.RaiseCanExecuteChanged(); RefreshParametersCommand.RaiseCanExecuteChanged(); }
private void OnTargetParameterUpdated(Object sender, EventArgs e) { UpdateParameterCommand.RaiseCanExecuteChanged(); }