public NotificationsView() { InitializeComponent(); ViewModel = new NotificationsViewmodel(); DataContext = ViewModel; Messenger.Default.Register <User>(this, ViewModel.RecieveSignInMessage); Messenger.Default.Register <SignOutMessageType>(this, ViewModel.RecieveSignOutMessage); Messenger.Default.Register(this, (UpdateAllNotificationsCountMessageType n) => { AppViewmodel.UnreadNotifications = new ObservableCollection <Notification>(AppViewmodel.UnreadNotifications.OrderBy(un => un.UpdatedAt)); ViewModel.UpdateAllNotificationIndicator(n.Count); Bindings.Update(); }); Messenger.Default.Register(this, (UpdateUnreadNotificationsCountMessageType n) => { ViewModel.UpdateUnreadNotificationIndicator(n.Count); Bindings.Update(); }); Messenger.Default.Register(this, (UpdateParticipatingNotificationsCountMessageType n) => { ViewModel.UpdateParticipatingNotificationIndicator(n.Count); Bindings.Update(); }); }
public NotificationsView() { this.InitializeComponent(); ViewModel = new NotificationsViewmodel(); this.DataContext = ViewModel; Loading += NotificationsView_Loading; NavigationCacheMode = NavigationCacheMode.Required; }
public NotificationsView() { this.InitializeComponent(); ViewModel = new NotificationsViewmodel(); this.DataContext = ViewModel; Messenger.Default.Register <User>(this, ViewModel.RecieveSignInMessage); Messenger.Default.Register <GlobalHelper.SignOutMessageType>(this, ViewModel.RecieveSignOutMessage); }