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);
 }
Exemple #2
0
        public void CreateViewModel()
        {
            MainVM mainVM = new MainVM();

            mainVM.CommandButtonVM.HotKeyHelper.Value = new HotKeyHelper(this);
            AddPanelHotkeys(mainVM.CommandButtonVM.HotKeyHelper.Value);
            DataContext = mainVM;
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #5
0
 public ConsoleControlVM(MainVM mainVM)
 {
     _mainVM = mainVM;
 }
Exemple #6
0
 public CommandButtonVM(MainVM mainVM)
 {
     _mainVM = mainVM;
     CreateCommands();
     ReactiveAction hotKeySetter = new ReactiveAction(RegisterHotKeys, HotKeyHelper);
 }