public Scenario3DEO() { InitializeComponent(); Scenario3 = this; deo = DisplayEnhancementOverride.GetForCurrentView(); SetNoBrightnessSettings(); SetNoColorScenario(); deo.IsOverrideActiveChanged += Deo_IsOverrideActiveChanged; deo.CanOverrideChanged += Deo_CanOverrideChanged; deo.DisplayEnhancementOverrideCapabilitiesChanged += Deo_DisplayEnhancementOverrideCapabilitiesChanged; comboBoxPercentage.ItemsSource = new List <string>() { "Slider", "Specific value" }; comboBoxPercentage.SelectionChanged += OnSelectionChangedPercentage; comboBoxNits.ItemsSource = new List <string>() { "Slider", "Specific value" }; comboBoxNits.SelectionChanged += OnSelectionChangedNits; PeriodicTimer.CreateDEO(); }
public void EnableSensor() { buttonSensor.IsEnabled = true; IsOn = !IsOn; buttonSensor.SetValue(AutomationProperties.NameProperty, ""); StackPanelSensor.Visibility = Visibility.Visible; StackPanelProperty.Visibility = Visibility.Visible; PeriodicTimer.CreateSensorDisplay(totalIndex); Sensor.EnableSensor(SensorType, Index, totalIndex); }
private void ButtonBackToMenu(object sender, RoutedEventArgs e) { if (lightSensor != null) { lightSensor.ReadingChanged -= LightSensorReadingChanged; } PeriodicTimer.Cancel2(); stackpanel4.Visibility = Visibility.Collapsed; stackpanel2.Visibility = Visibility.Visible; }
private void ButtonInternalExternal(object sender, RoutedEventArgs e) { stackpanel2.Visibility = Visibility.Collapsed; stackpanel4.Visibility = Visibility.Visible; if (lightSensor != null) { lightSensor.ReadingChanged += LightSensorReadingChanged; } PeriodicTimer.Create(); }
public void EnableSensor() { ButtonSensor.IsEnabled = true; ButtonSensor.Opacity = 1; ButtonSensor.SetValue(AutomationProperties.NameProperty, "x"); _isOn = !_isOn; ButtonSensor.SetValue(AutomationProperties.NameProperty, ""); StackPanelSensor.Visibility = Visibility.Visible; StackPanelSensor.Opacity = 1; PeriodicTimer.Create(_totalIndex); Sensor.EnableSensor(_sensorType, _index, _totalIndex); }
/// <summary> /// Unregister from App events and DeviceWatcher events because this page will be unloaded. /// </summary> protected override void OnNavigatedFrom(NavigationEventArgs eventArgs) { if (lightSensor != null) { lightSensor.ReadingChanged -= LightSensorReadingChanged; } PeriodicTimer.Cancel2(); DisconnectFromDeviceClick(null, null); StopDeviceWatchers(); StopHandlingAppEvents(); // We no longer care about the device being connected EventHandlerForDevice.Current.OnDeviceConnected = null; EventHandlerForDevice.Current.OnDeviceClose = null; IsNavigatedAway = true; CancelAllIoTasks(); }