public void Aggregate(BranchLabelModel aggregating, BranchLabelModel aggregated) { Aggregating = aggregating; Aggregated = aggregated; if (_conflict) { MainWindowModel.RaiseCantAggregateWhenConflict(); } else { MainWindowModel.OpenAggregatingContextMenu(); } }
public void NewCommitViewer(CommitNodeModel m) { CommitViewerTabViewModel cv; if (CommitViewers.Keys.Contains(m)) { cv = CommitViewers[m]; } else { cv = CreateViewer(m); CommitViewers.Add(m, cv); MainWindowModel.AddTab(cv); } SelectTab(cv); }
public void NewCommitEditor() { if (CommitEditorTab != null) { SelectTab(CommitEditorTab); return; } CommitEditorTabModel m = new CommitEditorTabModel(); m.CloseRequested += CloseTab; m.CommitRequest += Commit; CommitEditorTabViewModel vm = new CommitEditorTabViewModel(m); MainWindowModel.AddTab(vm); SelectTab(vm); }
public void AddMainTab() { if (MainTab != null) { SelectTab(MainTab); return; } MainTabModel m = new MainTabModel(); m.CloseRequested += CloseTab; m.MouseDown += (args) => CanvasMouseDown?.Invoke(null, args); m.MouseUp += (args) => CanvasMouseUp?.Invoke(null, args); m.PanelModel = ActionPanel; MainTabViewModel vm = new MainTabViewModel(m); MainTabModel = m; MainWindowModel.AddTab(vm); SelectTab(vm); }
Program() { ActionPanelModel localAM = new ActionPanelModel(); MainWindowViewModel mwvm = InitializeMainWindow(); ActionPanelModel remoteLeftAM = MainWindowModel.RemoteLeftPanelModel; ActionPanelModel remoteRightAM = MainWindowModel.RemoteRightPanelModel; CreateManagers(localAM, remoteLeftAM, remoteRightAM); InitializeEventHandlers(); InitializeState(); LibGitService.GetInstance().RepositoryChanged += CheckConflicts; LibGitService.GetInstance().RepositoryChanged += () => Show(null); LibGitService.GetInstance().RepositoryChanged += () => ActionsManager.OnWorkTreeChanged(LibGitService.GetInstance().HasChanges); StashMenuViewModel wm = new StashMenuViewModel(StashingManager.StashMenu); mwvm.StashMenu = wm; RepositoryManager.Opened += m => MainWindowModel.RepoPath = m.RepositoryPath; MainWindowModel.RecentRepos = RepositoryManager.RecentRepos; RepositoryManager.Closed += m => { MainWindowModel.RepoPath = ""; MainWindowModel.RecentRepos = RepositoryManager.RecentRepos; RemoteManager.Reset(); }; RepositoryManager.RecentRepositoryChanged += () => MainWindowModel.RecentRepos = RepositoryManager.RecentRepos; UserManager.UsersChanged += () => MainWindowModel.OnUsersChanged(); }
public MainWindowViewModel(MainWindowModel model, MainWindow view) { _mainWindow = view; SubscribeModel(model, view); view.DataContext = this; }
public TabManager(MainWindowModel w, ActionPanelModel localAM) { ActionPanel = localAM; MainWindowModel = w; }
void SelectTab(TabViewModel vm) { MainWindowModel.SelectTab(vm); }
public void CloseCommitEditorTab() { MainWindowModel.RemoveTab(CommitEditorTab); }