コード例 #1
0
        private async void OnAddColorButtonClick(object sender, RoutedEventArgs eventArgs)
        {
            SelectColorWindow dialog = new SelectColorWindow();
            Color             result = await dialog.ShowDialog <Color>(this);

            ColorPalette.Add(result);
            ReloadPaletteItems();
        }
コード例 #2
0
        private async void OnDuoTonePickColorButtonClick(object sender, RoutedEventArgs eventArgs)
        {
            Color             currentColor = ColorConvertors.HslToColor(((float)duoToneHueNumeric.Value, (float)duoToneSaturationNumeric.Value, 0.5f));
            SelectColorWindow dialog       = new SelectColorWindow(currentColor);
            Color             result       = await dialog.ShowDialog <Color>(this);

            var hslColor = ColorConvertors.ColorToHsl(result);

            duoToneHueNumeric.Value        = hslColor.H;
            duoToneSaturationNumeric.Value = hslColor.S;
        }
コード例 #3
0
        private async void OnColorListBoxDoubleTapped(object sender, RoutedEventArgs eventArgs)
        {
            if (colorsListBox.SelectedItem == null)
            {
                return;
            }
            Color             selectedColor = ((ColorPaletteItem)colorsListBox.SelectedItem).color;
            SelectColorWindow dialog        = new SelectColorWindow(selectedColor);
            Color             result        = await dialog.ShowDialog <Color>(this);

            ColorPalette[ColorPalette.IndexOf(selectedColor)] = result;
            ReloadPaletteItems();
        }