public void RemoveTab(TabViewModel vm) { Tabs.Remove(vm); ChangedTabs?.Invoke(); if (SelectedIndex > 0) { SelectedIndex -= 1; } ChangedIndex?.Invoke(); }
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(); } }
public void AddTab(TabViewModel vm) { Tabs.Add(vm); ChangedTabs?.Invoke(); }
public void SelectTab(TabViewModel vm) { SelectedIndex = Tabs.IndexOf(vm); ChangedIndex?.Invoke(); }
public void Close(TabViewModel vm) { CloseRequested?.Invoke(vm); }
void SelectTab(TabViewModel vm) { MainWindowModel.SelectTab(vm); }