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
Post a Comment