How do I Change the FontFamily on a ContentPresenter? How do I Change the FontFamily on a ContentPresenter? wpf wpf

How do I Change the FontFamily on a ContentPresenter?


You need to use the FontWeight property to specify a bold font. However, you've probably noticed that ContentPresenter doesn't have that property. So you'll need to use the TextBlock.FontWeight attached property to tell the ContentPresenter that any text inside it should be bold.

Try this:

<ContentPresenter TextBlock.FontFamily="Tahoma"                  TextBlock.FontWeight="Bold"                  SnapsToDevicePixels="True"                  HorizontalAlignment="Left"                  Margin="4,0,0,0"                  ContentSource="Header"                  VerticalAlignment="Center"                  RecognizesAccessKey="True" />


I can't help about Silverlight, but in the new WPF 4 it is TextElement rather than TextBlock