private void OnBackPressed(object sender, BackPressedEventArgs e) { if (this.Frame.CanGoBack) { DeviceVM.UnregisterVMFromModel(); this.Frame.GoBack(); e.Handled = true; // Unregister notifications off the UI thrad Utilities.RunFuncAsTask(GlobalSettings.SelectedDevice.UnregisterNotificationsAsync); } }