public RepositoryStatusBarVM(MainVM mainVM)
 {
     _mainVM = mainVM;
     SelectDirectoryCommand = new Action(SelectDirectory);
     Checkout = new Action <string>((branchName) => _mainVM.ConsoleControlVM.ExecuteCommand($"{GIT_CHECKOUT} {branchName}"));
     ReactiveAction branchNamesUpdater = new ReactiveAction(() => App.Current.Dispatcher.Invoke(UpdateBranchNames), _mainVM.Repo, _mainVM.RepoNotifier);
 }
Example #2
0
        public void CreateViewModel()
        {
            MainVM mainVM = new MainVM();

            mainVM.CommandButtonVM.HotKeyHelper.Value = new HotKeyHelper(this);
            AddPanelHotkeys(mainVM.CommandButtonVM.HotKeyHelper.Value);
            DataContext = mainVM;
        }
Example #3
0
        public DiffViewerVM(MainVM mainVM)
        {
            _mainVM = mainVM;

            // If the diff viewer's currently selected file gets changed, the diff viewer needs to be refreshed.
            // Since the diff viewer is not currently watching its file for changes, I will just refresh it on any repository changes.
            ReactiveAction itemUpdater = new ReactiveAction(() => Application.Current.Dispatcher.Invoke(RefreshDiffViewer), _mainVM.RepoNotifier, _mainVM.Repo);
        }
Example #4
0
        public FileStatusVM(MainVM mainVM)
        {
            _mainVM = mainVM;

            Stage   = new Action <string>((path) => _mainVM.ConsoleControlVM.ExecuteCommand($"{GIT_ADD} {path}"));
            Unstage = new Action <string>((path) => _mainVM.ConsoleControlVM.ExecuteCommand($"{GIT_RESET_HEAD} {path}"));

            // Call UpdateItems on the dispatcher to avoid threading issues.
            ReactiveAction itemUpdater = new ReactiveAction(() => Application.Current.Dispatcher.Invoke(UpdateItems), _mainVM.RepoNotifier, _mainVM.Repo);
        }
Example #5
0
 public ConsoleControlVM(MainVM mainVM)
 {
     _mainVM = mainVM;
 }
Example #6
0
 public CommandButtonVM(MainVM mainVM)
 {
     _mainVM = mainVM;
     CreateCommands();
     ReactiveAction hotKeySetter = new ReactiveAction(RegisterHotKeys, HotKeyHelper);
 }