private void Button_Click(object sender, RoutedEventArgs e) { ColorPickerDialog dialog = new ColorPickerDialog(); dialog.StartingColor = Color; dialog.Owner = Window.GetWindow(this); Nullable<bool> result = dialog.ShowDialog(); if (result != null && result == true) { Color = dialog.SelectedColor; } }
private void Button_Click(object sender, RoutedEventArgs e) { ColorPickerDialog dialog = new ColorPickerDialog(); dialog.StartingColor = Color; dialog.Owner = Window.GetWindow(this); Nullable <bool> result = dialog.ShowDialog(); if (result != null && result == true) { Color = dialog.SelectedColor; } }