Exemple #1
0
        private Color EditColor(Color color)
        {
            ColorPickerWindow dialog = new ColorPickerWindow(Application.Current.MainWindow);

            dialog.ColorPicker.SelectedColor = color;
            checkBatteryVM.StartForcedColor(color, specialActVM.DeviceNum);

            dialog.ColorChanged += OnColorChanged;
            dialog.ShowDialog();
            dialog.ColorChanged -= OnColorChanged;

            checkBatteryVM.EndForcedColor(specialActVM.DeviceNum);

            return(dialog.ColorPicker.SelectedColor.GetValueOrDefault());
        }
Exemple #2
0
        private void BatteryFullColorBtn_Click(object sender, RoutedEventArgs e)
        {
            ColorPickerWindow dialog = new ColorPickerWindow();

            dialog.Owner = Application.Current.MainWindow;
            Color tempcolor = checkBatteryVM.FullColor;

            dialog.colorPicker.SelectedColor = tempcolor;
            checkBatteryVM.StartForcedColor(tempcolor, specialActVM.DeviceNum);
            dialog.ColorChanged += (sender2, color) =>
            {
                checkBatteryVM.UpdateForcedColor(color, specialActVM.DeviceNum);
            };
            dialog.ShowDialog();
            checkBatteryVM.EndForcedColor(specialActVM.DeviceNum);
            checkBatteryVM.FullColor = dialog.colorPicker.SelectedColor.GetValueOrDefault();
        }
Exemple #3
0
 private void OnColorChanged(ColorPickerWindow sender, Color color)
 => checkBatteryVM.UpdateForcedColor(color, specialActVM.DeviceNum);