private void Save_Click(object sender, RoutedEventArgs e) { Settings_ErrorMessage.Text = ""; Settings.DisplayMode = Settings_DisplayMode.SelectedIndex; var saved = Shrek2MM.SaveSettings(Settings); if (!saved) { Settings_ErrorMessage.Text = "Failed to save the Settings. This could be because of Read/write permissions not being given. Ensure these permissions have been given."; return; } CloseModal?.Invoke(); }
private void Edited_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(EditMod_Title.Text)) { EditMod_ErrorMessage.Text = "Title cannot be empty!"; return; } if (Mod == null) { return; } Mod.Title = EditMod_Title.Text; Mod.Description = EditMod_Description.Text; EditedMod?.Invoke(Mod); CloseModal?.Invoke(); }
private void Cancel_Click(object sender, RoutedEventArgs e) { CloseModal?.Invoke(); }
public void Close(ModalResult modalResult) { modalResult.ModalType = this._modalType; CloseModal?.Invoke(); OnClose?.Invoke(modalResult); }
public void Cancel() { CloseModal?.Invoke(); OnClose?.Invoke(ModalResult.Cancel(this._modalType)); }
public void Cancel() { CloseModal?.Invoke(); OnClose?.Invoke(ModalResult.Cancel()); }
/// <summary> /// Closes the modal and invokes the <see cref="OnClose"/> event with the specified <paramref name="modalResult"/>. /// </summary> /// <param name="modalResult"></param> public void Close(ModalResult modalResult) { CloseModal?.Invoke(); OnClose?.Invoke(modalResult); OnClosePassedToShow?.Invoke(modalResult); }
private void Remove_Click(object sender, RoutedEventArgs e) { RemovedMod?.Invoke(); CloseModal?.Invoke(); }
/// <summary> /// Closes the modal and invokes the <see cref="OnClose"/> event with the specified <paramref name="modalResult"/>. /// </summary> /// <param name="modalResult"></param> public void Close(ModalResult modalResult) { CloseModal?.Invoke(); OnClose?.Invoke(modalResult); }
/// <summary> /// Invokes CloseModal Action to notify subscribers modal must close. /// </summary> public void CloseMatchesModal() => CloseModal?.Invoke();