public StatusTimelineViewModel(MainWindowViewModel main, StatusTimeline tl) { Source = tl; Statuses = ViewModelHelper.CreateReadOnlyDispatcherCollection( tl.Statuses, (p) => { if (!IsSelected) UnreadCount++; return new StatusViewModel(main, p); }, DispatcherHelper.UIDispatcher); Name = Source.Name; QueryText = Source.Query.QueryText; }
public void NewStatusTimeline() { var stt = new StatusTimeline(Kbtter.Setting, "true", "新しいやつ"); var vm = new StatusTimelineEditWindowViewModel { EditingTarget = new StatusTimelineViewModel(this, stt) }; Messenger.Raise(new TransitionMessage(vm, "StatusTimelineEdit")); if (vm.Updated) Kbtter.StatusTimelines.Add(stt); }