
What's the best way to hook up the SpectrumSlice control with its "frieds", SpectrumSlider and ColorComponentSlider? I'm trying to create a color dialog using these lovely controls, but because I want some distance between the slice and the slider, I can't just use the SpectrumColorPicker control (or can I?). Since I want to be able to set a common selected color for the dialog (color can be selected in other ways than just the ones used by the Actipro controls), I have defined a dependency property on my Window called SelectedColor/SelectedColorProperty. I have the following markup:
Unfortunately, it doesn't work like it does in the sample browser, where the two controls are used inside the SpectrumColorPicker. I'm not sure that I'm using the BaseColor property correctly, but if I don't use it at all, nothing seems to be working :). The problem is that when I click on the slider, the marker is reset and when I click somewhere in the slice, the BaseColor changes, making the slice look a bit weird. I just want the exact same behavior as in the SpectrumColorPicker, but with the ability to control e.g. the distance and border on the two separate controls. Please guide me :)
<shared:SpectrumSlice
SelectedColor="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=my:ColorDialog, AncestorLevel=1}, Path=SelectedColor, Mode=TwoWay}"
BaseColor="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=my:ColorDialog, AncestorLevel=1}, Path=SelectedColor, Mode=OneWay}" />
<shared:SpectrumSlider SelectedColor="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=my:ColorDialog, AncestorLevel=1}, Path=SelectedColor, Mode=TwoWay}" />