Ejemplo n.º 1
0
 private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     ResolvePageHeader(e.NavigationParameter.ToString());
     this.proximityViewModel = ProximityViewModel.GetInstance();
     InitialControls();
     if (await proximityViewModel.TryRetrieveServices())
     {
         ChangeScanToStopButton();
     }
     this.DataContext = proximityViewModel;
 }
Ejemplo n.º 2
0
 private void ProximityPage_Loaded(object sender, RoutedEventArgs e)
 {
     proximitySettingViewModel = SettingPivotViewModel.GetInstance().GetProximitySettingViewModel();
     if (ProximityViewModel.GetInstance().IsImmediateServiceStarted())
     {
         this.AlertOnDeviceToggle.IsOn = proximitySettingViewModel.IsImmediateButtonOn;
     }
     else
     {
         this.AlertOnDeviceToggle.IsEnabled = false;
     }
 }
Ejemplo n.º 3
0
        private void AlertOnDevice_Toggled(object sender, RoutedEventArgs e)
        {
            var alarmToggle = sender as ToggleSwitch;

            if (alarmToggle.IsOn)
            {
                if (ProximityViewModel.GetInstance().SetImmediateAlertOn())
                {
                    proximitySettingViewModel.UpdateImmediateAlarmGUI(true);
                }
                else
                {
                    SettingPivotViewModel.GetInstance().GetProximitySettingViewModel().SetServiceNotOnErrorMessage();
                    FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
                }
            }
            else
            {
                ProximityViewModel.GetInstance().SetImmediateAlertOff();
                proximitySettingViewModel.UpdateImmediateAlarmGUI(false);
            }
        }