This project has moved. For the latest updates, please go here.

Using ColorChooser X2

It is possible to use the Control the MVVM-way or the classic way.

The Main Control is ChooserX2 in the ColorChooserX2.Views-Namepsace. When an instance of it is created, it will get the Standard-ViewModel (HSVFieldViewModel) automatically.

Accessing the Colors

The ChooserX2-Instance has an ViewModel in it´s DataContext that implements the IColorChooser-Interface. So you´re able to access the currently selected (or hovered) color by

IColorChooser vm = chooserx2control.DataContext as IColorChooser;
if(vm!=null)
{
    Color selected = vm.SelectedColor;
    Color hovered = vm.HoverColor;
} 


You can register to the SelectedColor/HoverColor-Changed Event to listen for changes. Alternatively you can of course bind to The SelectedColor/HoverColor Property (like in the sample App). The Binding works TwoWay, so changes of the Members updates the GUI too.

What ColorChooser X2 is

I develop this small Chooser mainly for another project. But I thought it might be helpful for one of you, so I decided to create it as an OpenSource-Project.


Last edited Sep 18, 2012 at 11:55 AM by recursivebytes, version 4

Comments

No comments yet.