private HistoryItemViewModel Pop()
        {
            HistoryItemViewModel hc = HistoryItems[0];

            HistoryItems.Remove(hc);
            return(hc);
        }
        private HistoryItemViewModel CreateHistoryItem(NotepadItemViewModel item)
        {
            HistoryItemViewModel hc = new HistoryItemViewModel()
            {
                TextDocument       = item,
                ReopenFileCallback = ReopenAndRemoveFile
            };

            return(hc);
        }
 /// <summary>
 /// Opens the last closed file via callbacks
 /// </summary>
 public void ReopenLastFile()
 {
     if (HistoryItems.Count > 0)
     {
         HistoryItemViewModel hc = Pop();
         if (hc != null)
         {
             ReopenFile(hc);
         }
     }
 }
 private void ReopenAndRemoveFile(HistoryItemViewModel history)
 {
     HistoryItems.Remove(history);
     OpenFileCallback?.Invoke(history.TextDocument);
 }
 public void ReopenFile(HistoryItemViewModel hc)
 {
     OpenFileCallback?.Invoke(hc.TextDocument);
 }
        /// <summary>
        /// Pushes a file (that has just closed) to the history
        /// </summary>
        /// <param name="path"></param>
        public void PushFile(NotepadItemViewModel notepad)
        {
            HistoryItemViewModel item = CreateHistoryItem(notepad);

            Push(item);
        }
 public void Push(HistoryItemViewModel hc)
 {
     HistoryItems.Insert(0, hc);
     //Manager.PushCurrentState()
 }