I want to bind FontFamily to a TextBox to the property that I created on my ViewModel
Here is my xaml:
<TextBox Text="Test Font Binding" FontFamily="{Binding FontFirstContent}" />
And here is the property in my ViewModel:
public FontFamily FontFirstContent
{
get { return new FontFamily("Verdana"); }
}
When the view is loaded, the property receiver starts correctly, but it is not passed in the view. All the bindings in my view work except this one, so I donβt understand what is wrong with him?
Edit: Good, great! I was just working on the wrong FontFamily object. I used:
System.Drawing.FontFamily
But FontFamily must be of type:
System.Windows.Media.FontFamily
source
share