Final (I hope) follow up to this question -
I want to bind the Color property of this User Control to a User Settings property that will disseminate to several other controls.
I've done that in code (XAML, to be precise), but changes made to the User Control are not propagating to the control that should be receiving them.
In the past I've seen this work (with a simple Slider controlling the Border Width) : However, this is not working. Here is the XAML in question.
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:S="clr-namespace:EQLControls.Properties"
xmlns:Components="clr-namespace:WPFTools.Components;assembly=WPFTools"
xmlns:Converters="clr-namespace:WPFTools.Classes.Converters;assembly=WPFTools"
x:Class="EQLControls.Controls.UCPlayerPanel"
mc:Ignorable="d"
BorderThickness="{Binding PlayerBorderSize}"
FontFamily="{Binding PlayerFontFamily}"
FontWeight="{Binding PlayerFontWeight}"
Height="50" Width="100">
<UserControl.Background>
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
<GradientStop Color="{Binding PlayerBGColor1}"/>
<GradientStop Color="{Binding PlayerBGColor2}" Offset="1"/>
</LinearGradientBrush>
</UserControl.Background>
<UserControl.BorderBrush>
<SolidColorBrush Color="{Binding PlayerBorderColor}"/>
</UserControl.BorderBrush>
<UserControl.DataContext>
<S:Settings/>
</UserControl.DataContext>
I have a control bound to control the PlayerBGColor1 and PlayerBGColor2 of the Settings (Two way binding) in the project but changes made are not reflecting (instantly, anyway) against the User Control that is supposed to receive those changes from the control.
This is the XAML for the binding for the controls that are supposed to handle the PlayerBG1 and PlayerBG2 colors in the UserSettings :
<Controls:ColorDefiner Color="{Binding PlayerBGColor2, Mode=TwoWay}" Width="Auto" Height="Auto"/>
<Controls:ColorDefiner Color="{Binding PlayerBGColor1, Mode=TwoWay}" Width="Auto" Height="Auto"/>
Is what I am trying to achieve possible here, or will I need to find another way to do this?