Пример #1
0
        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;
        }