private async void OnAddColorButtonClick(object sender, RoutedEventArgs eventArgs) { SelectColorWindow dialog = new SelectColorWindow(); Color result = await dialog.ShowDialog <Color>(this); ColorPalette.Add(result); ReloadPaletteItems(); }
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; }
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(); }