/// <summary> /// Opens the last closed file via callbacks /// </summary> public void ReopenLastNotepad() { WindowHistoryControlViewModel hc = Pop(); if (hc != null) { ReopenNotepad(hc); } }
private WindowHistoryControlViewModel Pop() { if (HistoryItems.Count > 0) { WindowHistoryControlViewModel hc = HistoryItems[0]; HistoryItems.Remove(hc); return(hc); } return(null); }
/// <summary> /// Pushes a Notepad View's DataContext (that has just closed) to the history /// </summary> /// <param name="path"></param> public void PushNotepad(NotepadViewModel notepad) { WindowHistoryControlViewModel item = CreateHistoryItem(notepad); Push(item); }
private void Push(WindowHistoryControlViewModel hc) { HistoryItems.Insert(0, hc); }