Inheritance: Livet.ViewModel
 public InputDataViewModel(InputCoreViewModel parent,
                           InputData info, Action <InputData> removeHandler)
 {
     Parent         = parent;
     Model          = info;
     _removeHandler = removeHandler;
 }
 public InputDataViewModel(InputCoreViewModel parent,
                           InputData info, Action<InputData> removeHandler)
 {
     this.Parent = parent;
     this.Model = info;
     this._removeHandler = removeHandler;
 }
Example #3
0
 public void CloseInput()
 {
     if (!IsOpening)
     {
         return;
     }
     if (InputCoreViewModel.CheckClearInput())
     {
         // reset tab-account synchronization
         AccountSelectorViewModel.SynchronizeWithTab();
         // close
         IsOpening = false;
     }
     // move focus to timeline
     MainWindowModel.SetFocusTo(FocusRequest.Timeline);
 }
Example #4
0
        public InputViewModel()
        {
            this.CompositeDisposable.Add(_inputCoreViewModel = new InputCoreViewModel(this));
            this.CompositeDisposable.Add(_accountSelectorViewModel = new AccountSelectorViewModel(this));
            this.CompositeDisposable.Add(_postLimitPredictionViewModel = new PostLimitPredictionViewModel());

            this.CompositeDisposable.Add(
                new EventListener<Action>(
                    h => InputModel.FocusRequest += h,
                    h => InputModel.FocusRequest -= h,
                    () =>
                    {
                        OpenInput();
                        FocusToTextBox();
                    }));
            this.CompositeDisposable.Add(
                new EventListener<Action>(
                    h => InputModel.CloseRequest += h,
                    h => InputModel.CloseRequest -= h,
                    CloseInput));
            this.RegisterKeyAssigns();
        }
Example #5
0
 private void RegisterKeyAssigns()
 {
     KeyAssignManager.RegisterActions(
         KeyAssignAction.Create("CloseInput", CloseInput),
         KeyAssignAction.Create("Post", InputCoreViewModel.Send),
         KeyAssignAction.Create("LoadStash", () =>
     {
         if (InputCoreViewModel.IsDraftsExisted)
         {
             InputCoreViewModel.DraftedInputs[0].Writeback();
         }
     }),
         KeyAssignAction.Create("Amend", InputCoreViewModel.AmendLastPosted),
         KeyAssignAction.Create("AttachImage", () => { InputCoreViewModel.AttachImage(); }),
         KeyAssignAction.Create("ToggleEscape",
                                () => { InputCoreViewModel.IsUrlAutoEsacpeEnabled = !InputCoreViewModel.IsUrlAutoEsacpeEnabled; }),
         KeyAssignAction.Create("SelectNextAccount", () => AccountSelectorViewModel.SelectNext()),
         KeyAssignAction.Create("SelectPreviousAccount", () => AccountSelectorViewModel.SelectPrev()),
         KeyAssignAction.Create("ClearSelectedAccounts", () => AccountSelectorViewModel.ClearAll()),
         KeyAssignAction.Create("SelectAllAccounts", () => AccountSelectorViewModel.SelectAll())
         );
 }
Example #6
0
        public InputViewModel()
        {
            CompositeDisposable.Add(InputCoreViewModel           = new InputCoreViewModel(this));
            CompositeDisposable.Add(AccountSelectorViewModel     = new AccountSelectorViewModel(this));
            CompositeDisposable.Add(PostLimitPredictionViewModel = new PostLimitPredictionViewModel());

            CompositeDisposable.Add(
                new EventListener <Action>(
                    h => InputModel.FocusRequest += h,
                    h => InputModel.FocusRequest -= h,
                    () =>
            {
                OpenInput();
                FocusToTextBox();
            }));
            CompositeDisposable.Add(
                new EventListener <Action>(
                    h => InputModel.CloseRequest += h,
                    h => InputModel.CloseRequest -= h,
                    CloseInput));
            RegisterKeyAssigns();
        }