开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜