public void OnEvent(object sender, PropertyChangedEventArgs e) { if (kbtter.LatestEvent.Target.Id != kbtter.AuthenticatedUser.Id) { return; } var vm = new NotificationViewModel(kbtter.LatestEvent); TimelineNotifications.Insert(0, vm); RaisePropertyChanged("NotificationUpdate"); //if (EventUpdate != null) EventUpdate(this, vm); }
public void OnStatusUpdate(object sender, PropertyChangedEventArgs e) { var st = kbtter.LatestStatus.Status; TimelineStatuses.Insert(0, StatusViewModelExtension.CreateStatusViewModel(this, st)); RaisePropertyChanged("StatusUpdate"); if (st.RetweetedStatus != null) { if (st.RetweetedStatus.User.Id != kbtter.AuthenticatedUser.Id) { return; } var vm = new NotificationViewModel(st); TimelineNotifications.Insert(0, vm); //if (EventUpdate != null) EventUpdate(this, vm); return; } if (st.Entities != null && st.Entities.UserMentions.Count(p => p.ScreenName == kbtter.AuthenticatedUser.ScreenName) != 0) { var vm = new NotificationViewModel(st, this); TimelineNotifications.Insert(0, vm); //if (EventUpdate != null) EventUpdate(this, vm); } }