예제 #1
0
 public void RemoveTab(TabViewModel vm)
 {
     Tabs.Remove(vm);
     ChangedTabs?.Invoke();
     if (SelectedIndex > 0)
     {
         SelectedIndex -= 1;
     }
     ChangedIndex?.Invoke();
 }
예제 #2
0
 public void CloseTab(TabViewModel vm)
 {
     if (vm is MainTabViewModel)
     {
         DoCloseTab((MainTabViewModel)vm);
     }
     else if (vm is CommitEditorTabViewModel)
     {
         DoCloseTab((CommitEditorTabViewModel)vm);
     }
     else if (vm is CommitViewerTabViewModel)
     {
         DoCloseTab((CommitViewerTabViewModel)vm);
     }
     else if (vm is ConflictEditorTabViewModel)
     {
         DoCloseTab((ConflictEditorTabViewModel)vm);
     }
     else
     {
         throw new NotImplementedException();
     }
 }
예제 #3
0
 public void AddTab(TabViewModel vm)
 {
     Tabs.Add(vm);
     ChangedTabs?.Invoke();
 }
예제 #4
0
 public void SelectTab(TabViewModel vm)
 {
     SelectedIndex = Tabs.IndexOf(vm);
     ChangedIndex?.Invoke();
 }
예제 #5
0
 public void Close(TabViewModel vm)
 {
     CloseRequested?.Invoke(vm);
 }
예제 #6
0
 void SelectTab(TabViewModel vm)
 {
     MainWindowModel.SelectTab(vm);
 }