Share:

Example of ColorPicker and ColorPalette

Here is the example.

XAML (.xaml)

<gui:ColorPicker x:Name="ColorPicker"/>
<gui:ColorPalette x:Name="ColorPalette"/>

C# (.cs)

private bool IsLockedPickerAndPalette = false;
private void Event()
{
this.Loaded += (sender, e) =>
{
ColorPalette.ImportColorPalette();
};
ColorPicker.SelectedColorChanged += (sender, e) =>
{
if (IsLockedPickerAndPalette == false)
{
IsLockedPickerAndPalette = true;
ColorPalette.CurrentColor = ColorPicker.SelectedColor;
IsLockedPickerAndPalette = false;
}
};
ColorPalette.CurrentColorChanged += (sender, e) =>
{
if (IsLockedPickerAndPalette == false)
{
IsLockedPickerAndPalette = true;
ColorPicker.SelectedColor = ColorPalette.CurrentColor;
IsLockedPickerAndPalette = false;
}
};
this.Closing += (sender, e) =>
{
ColorPalette.ExportColorPalette();
};
}



Comments

Popular posts from this blog

Get Color From Pixel C# WPF | Saatody | Amit Padhiyar

Basic Audio Operations With MP3 And Wave Files Using NAudio C#

Create Drag And Drop Operation Between DevExpress GridControl And Custom WPF UI | Saatody | Amit Padhiyar