开发者

How to change default Xaml TextBox fontsize

开发者 https://www.devze.com 2023-01-07 05:32 出处:网络
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?

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消