private void SelectViewMode(NoteViewModes mode) { if (mode == NoteViewModes.Default) { if (Hub.Instance.Settings.DefaultNoteView == "View") { mode = NoteViewModes.View; } else if (Hub.Instance.Settings.DefaultNoteView == "Split") { mode = NoteViewModes.Split; } else if (Hub.Instance.Settings.DefaultNoteView == "Edit") { mode = NoteViewModes.Edit; } } Button source = null; if (Model.CurrentNote != null && string.IsNullOrEmpty(Model.CurrentNote.Note.DecryptedText)) { if (mode == NoteViewModes.Split) { source = SplitModeButton; } else { source = EditModeButton; } } else { if (mode == NoteViewModes.View) { source = ViewModeButton; } else if (mode == NoteViewModes.Split) { source = SplitModeButton; } else if (mode == NoteViewModes.Edit) { source = EditModeButton; } } if (source != null) { ViewModeButtonClicked(source, null); } }
public ChangeViewMode(NoteViewModes mode) { Mode = mode; }