How to change default Xaml TextBox fontsize
In my file.xaml, how can I set the TextBlock default size, so that I don't have to include that attribute in the TextBlock element?
<UserControl.Resources>
<!-- how?/can i set the default font si开发者_如何转开发ze for textblock element here? -->
</UserControl.Resources>
<Grid>
<StackPanel>
<TextBlock Text="{Binding HelloWorld}" />
</StackPanel>
</Grid>
Place this instead of your comment at UserControl.Resources
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="20" />
</Style>
精彩评论