I create the style in the xaml but in the code behind I recive a NULL value how exactly I supposed to do this code? Sorry for the question im new in this and I want to learn.
This is the xaml code:
<Style x:Key="TextBoxProperties" x:Name="TextBoxProperties" TargetType="TextBlock">
<Setter x:Name="textFontSize" Property="FontSize" Value="24"></Setter>
<Setter x:Name="textTypography" Property="FontFamily" Value="Resources/Fonts/Bryant-BoldAlt_Italic__Santillana.ttf#Bryant"></Setter>
</Style>
This is the code behind:
private void btnIncreaseFont_Click(object sender, RoutedEventArgs e)
{
if (currentFontSize < MAX_FONTSIZE)
{
if (btnDecreaseFont.IsEnabled == false)
btnDecreaseFont.IsEnabled = true;
currentFontSize += 2;
TextBoxProperties.Setters.Add(textFontSize);
TextBoxProperties.Setters.Add(textTypography);
UpdateCurrentPage();
}
else
btnIncreaseFont.IsEnabled = false;
}