This is a follow up question to the one I asked here -
The control class has a dependency property -
private static readonly DependencyProperty
_Color = DependencyProperty.Register( "Color", typeof( Color ), typeof( ColorDefiner ), new PropertyMetadata( Colors.Black ) );
public Color Color {
get { return ( Color )this.GetValue( ColorDefiner._Color ); }
set { this.SetValue( ColorDefiner._Color, value ); }
}
In the control XAML, how do I access that property so that I may bind it bi-directionaly to the controls sliders responsible for defining the color property?
EDIT
This is the code for one of the sliders -
<Slider
x:Name="sdrRed" Height="32" Minimum="0" Maximum="1" Width="294" TickPlacement="Both"
TickFrequency="0.01" Value="{Binding Color, Mode=TwoWay, ElementName=Me}">
</Slider>
Me
is the name of the UserControl
. My thinking is that the problem is because I am pointing to the Color.ScR
and etc.
Rather than binding the Value of the Slider to the Color property, I think I need to bind the Color property to a MultiBinding using the Slider Value properties.
EDIT
This to me feels like a place where I should implement MVVM - Can someone tell me how I might go about doing that here?