public Menu() { var app = Application.Current as App; appointmentController = app.appointmentController; notificationController = app.notificationController; InitializeComponent(); MyEvents.CloseLanguage.CustomEvent += closeLanguage; ModelHCI.AppointmentsData appointments = new ModelHCI.AppointmentsData(); List <NotificationHCI> notifications = new List <NotificationHCI>(); foreach (Notification n in notificationController.GetNotificationsForUser(MainWindow.doctor.Username)) { NotificationHCI notification = new NotificationHCI(); notification.text = n.ContentOfNotification; notification.category = n.NotificationCategory.ToString(); if (n.NotificationCategory == NotificationCategory.BLOG) { notification.icon = new PackIcon() { Kind = PackIconKind.Blogger }; } else if (n.NotificationCategory == NotificationCategory.MEDICATION) { notification.icon = new PackIcon() { Kind = PackIconKind.Pill }; } else if (n.NotificationCategory == NotificationCategory.SCHEDULE) { notification.icon = new PackIcon() { Kind = PackIconKind.Schedule }; } notifications.Add(notification); } NotificationsList.ItemsSource = notifications; }
private void Notifications_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!demoOn) { if (NotificationsList.SelectedItem != null) { NotificationHCI notification = (NotificationHCI)NotificationsList.SelectedItem; if (notification.category.Equals(NotificationCategory.MEDICATION.ToString())) { Frame_Change.Navigate(new Uri("Pages/Medications.xaml", UriKind.Relative)); } else if (notification.category.Equals(NotificationCategory.SCHEDULE.ToString())) { Frame_Change.Navigate(new Uri("Pages/Schedule.xaml", UriKind.Relative)); } else if (notification.category.Equals(NotificationCategory.BLOG.ToString())) { Frame_Change.Navigate(new Uri("Pages/Blog.xaml", UriKind.Relative)); } } } }