Esempio n. 1
0
 public SearchFlipViewModel()
 {
     if (DesignTimeUtil.IsInDesignMode) return;
     _candidateViewModel = new SearchCandidateViewModel(this);
     this.CompositeDisposable.Add(
         Observable.FromEvent(
             h => KeyAssignManager.KeyAssignChanged += h,
             h => KeyAssignManager.KeyAssignChanged -= h)
                   .Subscribe(_ => RaisePropertyChanged(() => SearchHintLabel)));
     this.CompositeDisposable.Add(
         new EventListener<Action<string, SearchMode>>(
             h => SearchFlipModel.SearchRequested += h,
             h => SearchFlipModel.SearchRequested -= h,
             (query, mode) =>
             {
                 this.Open();
                 // to do nothing.
                 if (Text == query && SearchMode == mode) return;
                 Text = query;
                 if (SearchMode == mode)
                 {
                     this.CommitSearch();
                 }
                 else
                 {
                     SearchMode = mode;
                 }
             }));
     this.CompositeDisposable.Add(
         new EventListener<Action>(
             h => InputModel.FocusRequest += h,
             h => InputModel.FocusRequest -= h,
             this.CloseCore));
 }
Esempio n. 2
0
 public SearchCandidateItemViewModel(SearchCandidateViewModel parent,
                                     TwitterAccount account, long id, string query)
 {
     _parent       = parent;
     this._account = account;
     _id           = id;
     _query        = query;
 }
 public SearchCandidateItemViewModel(SearchCandidateViewModel parent,
     AuthenticateInfo authenticateInfo, long id, string query)
 {
     _parent = parent;
     _authenticateInfo = authenticateInfo;
     _id = id;
     _query = query;
 }
 public SearchCandidateItemViewModel(SearchCandidateViewModel parent,
     TwitterAccount account, long id, string query)
 {
     _parent = parent;
     this._account = account;
     _id = id;
     _query = query;
 }