Hello,
I'm trying to develop a custom tri-state button user control and so far I've been using CTF to set properties.
But I would like to change this to be using the WPF property system with PropertiesDependencies.
Unfortunately I don't manage to make it work, when I set the property from my xaml (father) using a DynamicResource, the value is not set.
<common:StateImageButton x:Name="story_buttonRecord" BackTest="{DynamicResource backTest}" />
Here is the code I have in my button controller :
public ImageSource BackTest
{
get { return (ImageSource)this.GetValue(BackProp); }
set { this.SetValue(WidthProp,value); }
}
public static readonly DependencyProperty BackProp =
DependencyProperty.Register(
"BackTest",
typeof(ImageSource),
typeof(StateImageButton),
new FrameworkPropertyMetadata());
I don't even use the property in my button xaml yet, but it apparently doesn't even enter in the Setter. I've been searching a lot online without success. So maybe I'm missing something .
Thanks in advance for your help, Boris