private async void NotificationResponse(Message message) { //store patient id if (StoredData.getPatientID() == null) { StoredData.setPatientID(message.ID); } patientStatus = message.status;//set status OnReceivePatientStatus(message.status); await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () => ShowLatestSample(message.lat, message.lon)); switch (message.status) { case Notifications.Status.ConnectionLost: Notifications.OnLostConnAlert(message.name); break; case Notifications.Status.Distress: Notifications.OnDistressAlert(message.name); break; case Notifications.Status.NeedsAssistance: Notifications.OnHelpButtonAlert(message.name); break; case Notifications.Status.Risk: Notifications.OnRiskAlert(message.name); break; case Notifications.Status.Wandering: Notifications.OnWanderingAlert(message.name); break; } }
private async void OnReceivePatientStatus(Notifications.Status status) { switch (status) { case Notifications.Status.ConnectionLost: await patientStatusInd.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () => { patientStatusInd.Text = " CONNECION LOST"; patientStatusInd.Foreground = new SolidColorBrush(Colors.Red); }); return; case Notifications.Status.Distress: await patientStatusInd.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () => { patientStatusInd.Text = " DISTRESS"; patientStatusInd.Foreground = new SolidColorBrush(Colors.Yellow); }); return; case Notifications.Status.NeedsAssistance: await patientStatusInd.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () => { patientStatusInd.Text = " NEEDS ASSISTANCE"; patientStatusInd.Foreground = new SolidColorBrush(Colors.Red); }); return; case Notifications.Status.Risk: await patientStatusInd.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () => { patientStatusInd.Text = " RISK"; patientStatusInd.Foreground = new SolidColorBrush(Colors.Red); }); return; case Notifications.Status.Wandering: await patientStatusInd.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () => { patientStatusInd.Text = " WANDERING"; patientStatusInd.Foreground = new SolidColorBrush(Colors.LightCoral); }); return; case Notifications.Status.Learning: await patientStatusInd.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () => { patientStatusInd.Text = " LEARNING"; patientStatusInd.Foreground = new SolidColorBrush(Colors.Orange); }); return; case Notifications.Status.Safety: await patientStatusInd.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () => { patientStatusInd.Text = " OK"; patientStatusInd.Foreground = new SolidColorBrush(Colors.Green); }); return; } }