Question How to set a custom font style for a button

skanie

New member
Joined
Jan 10, 2024
Messages
1
Programming Experience
1-3
The bottom line is that everything works fine with the text, but the font is not transferred to the buttons and is default font after compilation
app.xaml
<Application.Resources>
<Style x:Key="Hatten">
<Setter Property="TextElement.FontFamily" Value="/View/Res/Fonts/#Intro" />
</Style>
<Style x:Key="HattenButton" TargetType="Button">
<Setter Property="FontFamily" Value="/View/Res/Fonts/#Intro" />
</Style>
</Application.Resources>
MainWindow.xaml
<Button x:Name="downloadButton" Content="УСТАНОВИТЬ" HorizontalAlignment="Left" Margin="200,510,0,0" VerticalAlignment="Top" Width="400" Height="74" FontFamily="Intro " FontSize="32" Foreground="#FF0F1923" Background="#FFEF4958" BorderBrush="{x:Null}" Cursor="Hand" Click="downloadButtonClick" Style="{StaticResource HattenButton}"/>
In 1 photo, how it should be, in the second, how it looks
 

Latest posts

Back
Top Bottom