My page xaml:
<header:DefaultText x:Name="header" HeaderText="{Binding Resources.HeaderTitle}"/>
My DefaultText.cs DependencyProperty:
public string HeaderText
{
get { return (string)GetValue(HeaderTextProperty); }
set
{ //This part is never called when binding, but it is with static text
SetValue(HeaderTextProperty, value);
SetText(value);
}
}
public readonly DependencyProperty HeaderTextProperty = DependencyProperty.Register("HeaderText", typeof(string), typeof(DefaultText), new PropertyMetadata(string.Empty));
My problem is that when I set the HeaderText property with a binding the setter isn't called, but when I use a normal string without binding it is called.
I already tried the answers of similar questions like: WPF Binding to variable / DependencyProperty