code_junkie

WPF - Add Custom Font

Nov 12th, 2011
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <Window.Resources>
  2. <Style x:Key="Gotham-XLight">
  3. <Setter Property="TextElement.FontFamily" Value="/CustomFonts;Component/#Gotham-XLight" />
  4. </Style>
  5. </Window.Resources>
  6.  
  7. <TextBlock x:Name="TimeTextBlock" Style="{DynamicResource Gotham-XLight}" TextAlignment="Center" FontSize="25" FontWeight="Bold" Foreground="White" Text="TextBlockTimer" Margin="105,242.974,0,226.975" HorizontalAlignment="Left" Width="221.919" />
  8.  
  9. <Window.Resources>
  10. <Style x:Key="Gotham-XLight">
  11. <Setter Property="TextElement.FontFamily" Value="CustomFonts/#Gotham-XLight" />
  12. </Style>
  13. </Window.Resources>
Add Comment
Please, Sign In to add comment