public TimelineTabViewModel(TimelineBlock block) : base(block) { if (this.IsInDesignMode) return; this.block = block; this.CompositeDisposable.Add(new PropertyChangedEventListener(block) { { "Statuses", (sender, e) => this.InitializeStatuses() }, { "UnreadCount", (sender, e) => this.Counter = this.block.UnreadCount }, }); this.InitializeStatuses(); this.IsConfigMode = false; this.ConfigPanel = new ConfigPanelViewModel(block); }
public ConfigPanelViewModel(TimelineBlock block) { this.block = block; this.CompositeDisposable.Add(new PropertyChangedEventListener(block) { (sender, e) => this.RaisePropertyChanged(e.PropertyName), }); this._CurrentAccount = AccountViewModel.Get(block.Account); this.CompositeDisposable.Add(new CollectionChangedEventListener(TwitterClient.Current.Accounts) { // アカウントのコレクションが更新されたとき、現在のアカウントが設定されていなければ、再取得する (sender, e) => { if (!this.CurrentAccount.IsValid) this.CurrentAccount = AccountViewModel.Get(block.Account); }, }); this.ReceivingSettings = block.IsReceivingAll ? "受信したすべてのツイート" : block.Timeline.SubscribedLists.ToString(" "); }
public void AddTab() { var block = new TimelineBlock { Name = "新しいタブ" }; MukyutterClient.Current.BlockItems.Add(block); var viewmodel = this.TabItems.FirstOrDefault(t => t.Block == block) as TimelineTabViewModel; if (viewmodel != null) { viewmodel.IsConfigMode = true; this.SelectedTabItem = viewmodel; } }