Exemplo n.º 1
0
 public InputBlockViewModel(MainWindowViewModel parent)
 {
     this.Parent = parent;
     this._imageStackingViewViewModel                 = new ImageStackingViewViewModel();
     this._userSelectorViewModel                      = new UserSelectorViewModel();
     this._userSelectorViewModel.LinkChanged         += () => this.LinkUserChanged(this.UserSelectorViewModel.LinkElements);
     this._inputUserSelectorViewModel                 = new UserSelectorViewModel();
     this._inputUserSelectorViewModel.LinkChanged    += this.inputLinkUserChanged;
     this._intelliSenseTextBoxViewModel               = new IntelliSenseTextBoxViewModel();
     this._intelliSenseTextBoxViewModel.TextChanged  += (o, e) => invalidateTagBindState();
     this._intelliSenseTextBoxViewModel.TextChanged  += (o, e) => RaisePropertyChanged(() => IsDirectMessage);
     this._intelliSenseTextBoxViewModel.TextChanged  += (o, e) => RaisePropertyChanged(() => DirectMessageTarget);
     this._intelliSenseTextBoxViewModel.TextChanged  += (o, e) => RaisePropertyChanged(() => IsInReplyToEnabled);
     this._intelliSenseTextBoxViewModel.ItemsOpening += (o, e) => _intelliSenseTextBoxViewModel_OnItemsOpening();
     this._intelliSenseTextBoxViewModel.FileDrop     += (o, e) => AttachImage(e.FilePath);
     // Listen changing tab
     this.Parent.ColumnOwnerViewModel.CurrentTabChanged += new Action <TabViewModel>(CurrentTabChanged);
     RegisterKeyAssign();
     ViewModelHelper.BindNotification(Setting.SettingValueChangedEvent, this, (o, e) =>
     {
         RaisePropertyChanged(() => WorkerViewDockOrientation);
         RaisePropertyChanged(() => PostBoxOpenForeground);
         RaisePropertyChanged(() => PostBoxOpenBackground);
         RaisePropertyChanged(() => PostBoxCloseForeground);
         RaisePropertyChanged(() => PostBoxCloseBackground);
         RaisePropertyChanged(() => PostBoxBorder);
     });
 }
Exemplo n.º 2
0
        public MainWindowViewModel()
        {
            KernelService.MainWindowViewModel = this;
            this._columnOwnerViewModel        = new ColumnOwnerViewModel(this);
            this._notifierViewModel           = new NotifierViewModel(this);
            this._notifyBlockViewModel        = new NotifyBlockViewModel(this);
            // Input block dependents ColumnOwnerViewModel
            this._inputBlockViewModel = new InputBlockViewModel(this);

            this._userSelectionViewModel           = new UserSelectionViewModel();
            this._userSelectionViewModel.Finished += () =>
            {
                this._isVisibleUserSelection = false;
                RaisePropertyChanged(() => IsVisibleUserSelection);
                RaisePropertyChanged(() => IsActivateMain);
            };
            ViewModelHelper.BindNotification(Setting.SettingValueChangedEvent, this, (o, e) =>
            {
                RaisePropertyChanged(() => IsNotifierBarBottom);
                RaisePropertyChanged(() => NotifierBarColumn);
                RaisePropertyChanged(() => IsInputBlockBottom);
                RaisePropertyChanged(() => InputBlockColumn);
                RaisePropertyChanged(() => FontFamily);
                RaisePropertyChanged(() => FontSize);
                RaisePropertyChanged(() => BackgroundImagePath);
            });
        }
Exemplo n.º 3
0
 public IntelliSenseTextBoxViewModel()
 {
     ViewModelHelper.BindNotification(Setting.SettingValueChangedEvent, this, (_, __) =>
     {
         RaisePropertyChanged(() => Foreground);
         RaisePropertyChanged(() => Background);
     });
 }
Exemplo n.º 4
0
 public InputDescription(IntelliSenseTextBoxViewModel intelliSenseTextBoxViewModel)
 {
     this.isTextBoxVM = intelliSenseTextBoxViewModel;
     ViewModelHelper.BindNotification(intelliSenseTextBoxViewModel.TextChangedEvent, this, (o, e) =>
     {
         this.InputText = this.isTextBoxVM.TextBoxText;
     });
     // Initialize
     this.isTextBoxVM.TextBoxText = String.Empty;
 }
Exemplo n.º 5
0
        public TabViewModel(ColumnViewModel parent, TabProperty property = null)
        {
            this.Parent = parent;

            this.IsAlive     = true;
            this.TabProperty = property ?? new TabProperty();

            // 初期TLとしてnullを
            this.AddTopTimeline(null);
            ViewModelHelper.BindNotification(Setting.SettingValueChangedEvent, this, (o, e) => UpdateSettingValue());
        }
Exemplo n.º 6
0
 public UserPageViewModel(TabViewModel parent, string userId)
 {
     this.Parent = parent;
     this._timelineListCoreViewModel = new TimelineListCoreViewModel(parent, new IFilter[0]);
     this.SetUser(userId);
     ViewModelHelper.BindNotification(Setting.SettingValueChangedEvent, this, (_, __) =>
     {
         RaisePropertyChanged(() => UserProfileBackground);
         RaisePropertyChanged(() => UserProfileDarkBackground);
     });
 }
Exemplo n.º 7
0
 public TimelineListCoreViewModel(TabViewModel parent, IEnumerable <IFilter> sources)
 {
     if (parent == null)
     {
         throw new ArgumentNullException("parent");
     }
     this._tweetsSource = new CachedConcurrentObservableCollection <TabDependentTweetViewModel>();
     this.Parent        = parent;
     this.sources       = sources;
     UpdateReacceptionChain(sources, true);
     // binding nortifications
     ViewModelHelper.BindNotification(TweetStorage.TweetStorageChangedEvent, this, TweetStorageChanged);
     ViewModelHelper.BindNotification(Setting.SettingValueChangedEvent, this, SettingValueChanged);
     // Generate timeline
     Task.Factory.StartNew(() => this.InvalidateCache());
 }
Exemplo n.º 8
0
 public AccountViewModel(AccountInfo info)
 {
     this.Info = info;
     this._profileImageProvider = new Common.ProfileImageProvider(info);
     Task.Factory.StartNew(() => UpdatePostChunk());
     ViewModelHelper.BindNotification(info.ConnectionStateChangedEvent, this,
                                      (o, e) => RaisePropertyChanged(() => ConnectState));
     ViewModelHelper.BindNotification(TimeTickCall, this, (o, e) =>
     {
         Task.Factory.StartNew(() => UpdatePostChunk());
     });
     ViewModelHelper.BindNotification(PostOffice.OnUnderControlChangedEvent, this, (o, e) =>
     {
         RaisePropertyChanged(() => IsAccountUnderControlled);
         RaisePropertyChanged(() => AccountControlReleaseTime);
     });
 }
Exemplo n.º 9
0
 public NotifyBlockViewModel(MainWindowViewModel parent)
 {
     this.Parent = parent;
     // InformServer.EventRegistered += new InformServer.NotifyEventHandler(InformServer_EventRegistered);
     // InformServer.ReportRegistered += new InformServer.ReportRegisterHandler(InformServer_ReportRegistered);
     ViewModelHelper.BindNotification(NotifyStorage.NotifyTextChangedEvent, this, (o, e) =>
     {
         RaisePropertyChanged(() => StatusText);
         RaisePropertyChanged(() => IsLongRunning);
     });
     ViewModelHelper.BindNotification(ExceptionStorage.ExceptionUpdatedEvent, this, (o, e) => RaisePropertyChanged(() => State));
     ViewModelHelper.BindNotification(Statistics.WakeupTimeUpdatedEvent, this, (o, e) => RaisePropertyChanged(() => WakeupTime));
     ViewModelHelper.BindNotification(Statistics.TweetSpeedUpdatedEvent, this, (o, e) =>
     {
         RaisePropertyChanged(() => TweetSpeed);
         RaisePropertyChanged(() => TweetSpeedRank);
     });
     ViewModelHelper.BindNotification(PostOffice.OnUnderControlChangedEvent, this, (o, e) => RaisePropertyChanged(() => State));
     ViewModelHelper.BindNotification(TweetStorage.TweetStorageChangedEvent, this, (o, e) => RaisePropertyChanged(() => Tweets));
     ViewModelHelper.BindNotification(ConnectionManager.ConnectionStateChangedEvent, this, (o, e) => RaisePropertyChanged(() => State));
     ViewModelHelper.BindNotification(Setting.SettingValueChangedEvent, this, (_, __) => RaisePropertyChanged(() => StatusBarBackground));
     ImageCacheStorage.DownloadingChanged += () => RaisePropertyChanged(() => ImageDownloading);
 }
Exemplo n.º 10
0
 public AccountConfigViewModel()
 {
     IsAccountModified = false;
     ViewModelHelper.BindNotification(AccountStorage.AccountsChangedEvent,
                                      this, (o, e) => RaisePropertyChanged(() => Accounts));
 }
Exemplo n.º 11
0
 public ColumnViewModel(ColumnOwnerViewModel parent)
 {
     this.Parent = parent;
     ViewModelHelper.BindNotification(Setting.SettingValueChangedEvent, this, (o, e) => RaisePropertyChanged(() => TabColumn));
 }
Exemplo n.º 12
0
 public UserSelectorViewModel()
 {
     ViewModelHelper.BindNotification(AccountStorage.AccountsChangedEvent, this, (o, e) => MakeTargets());
 }
Exemplo n.º 13
0
 public NotifierViewModel(MainWindowViewModel parent)
 {
     this.Parent = parent;
     ViewModelHelper.BindNotification(EventStorage.EventRegisteredEvent, this, OnEventRegistered);
 }
Exemplo n.º 14
0
 public TwitterEventInfoViewModel()
 {
     ViewModelHelper.BindNotification(EventStorage.EventChangedEvent, this, (o, e) => TwitterEventInfoChanged());
 }
Exemplo n.º 15
0
 public SystemInfoViewModel()
 {
     ViewModelHelper.BindNotification(AccountStorage.AccountsChangedEvent, this, (o, e) => RaisePropertyChanged(() => Accounts));
     ViewModelHelper.BindNotification(ExceptionStorage.ExceptionUpdatedEvent, this, (o, e) => RaisePropertyChanged(() => Exceptions));
 }