Ejemplo n.º 1
0
 public UserInfoViewModel(SearchFlipViewModel parent, string screenName)
 {
     this._parent     = parent;
     this._screenName = screenName;
     this.CompositeDisposable.Add(
         parent.ListenPropertyChanged(() => parent.DisplaySlimView,
                                      _ => RaisePropertyChanged(() => DisplaySlimView)));
     LoadUser(screenName);
 }
Ejemplo n.º 2
0
        public UserInfoViewModel(SearchFlipViewModel parent, string screenName)
        {
            this._parent = parent;
            this._screenName = screenName;
            this.CompositeDisposable.Add(
                parent.ListenPropertyChanged(() => parent.DisplaySlimView)
                      .Subscribe(_ => RaisePropertyChanged(() => DisplaySlimView)));
            this.CompositeDisposable.Add(
                StoreHelper.GetUser(screenName)
                           .Finally(() => Communicating = false)
                           .ObserveOnDispatcher()
                           .Subscribe(
                               user =>
                               {
                                   User = new UserViewModel(user);
                                   this.CompositeDisposable.Add(User);

                                   this.CompositeDisposable.Add(this._statuses = new UserTimelineViewModel(this,
                                       new UserTimelineModel(user.Id, TimelineType.User)));
                                   this.RaisePropertyChanged(() => Statuses);

                                   this.CompositeDisposable.Add(this._favorites = new UserTimelineViewModel(this,
                                       new UserTimelineModel(user.Id, TimelineType.Favorites)));
                                   this.RaisePropertyChanged(() => Favorites);

                                   this.CompositeDisposable.Add(this._following = new UserFollowingViewModel(this));
                                   this.RaisePropertyChanged(() => Following);

                                   this.CompositeDisposable.Add(this._followers = new UserFollowersViewModel(this));
                                   this.RaisePropertyChanged(() => Followers);

                                   Setting.Accounts.Collection
                                          .Where(a => a.Id != user.Id)
                                          .Select(a => new RelationControlViewModel(this, a, user))
                                          .ForEach(RelationControls.Add);
                               },
                               ex =>
                               {
                                   parent.Messenger.RaiseSafe(() => new TaskDialogMessage(new TaskDialogOptions
                                   {
                                       Title = SearchFlipResources.MsgUserInfoLoadErrorTitle,
                                       MainIcon = VistaTaskDialogIcon.Error,
                                       MainInstruction = SearchFlipResources.MsgUserInfoLoadErrorInst,
                                       Content = ex.Message,
                                       CommonButtons = TaskDialogCommonButtons.Close
                                   }));
                                   User = null;
                                   parent.CloseResults();
                               }));
        }
Ejemplo n.º 3
0
        public UserInfoViewModel(SearchFlipViewModel parent, string screenName)
        {
            this._parent = parent;
            this._screenName = screenName;
            this.CompositeDisposable.Add(
                parent.ListenPropertyChanged(() => parent.DisplaySlimView,
                    _ => RaisePropertyChanged(() => DisplaySlimView)));
            LoadUser(screenName);

        }