Exemple #1
0
        private void BatteryEmptyColorBtn_Click(object sender, RoutedEventArgs e)
        {
            ColorPickerWindow dialog = new ColorPickerWindow();

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

            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.EmptyColor = dialog.colorPicker.SelectedColor.GetValueOrDefault();
        }
Exemple #2
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());
        }