如何更改全景项目标题的字体大小? [英] How to change font size of Panorama item header?

查看:22
本文介绍了如何更改全景项目标题的字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一次性设置全景项目标题的字体大小以便它可用于我应用中的所有项目标题的最简单方法是什么?

What is the easiest way to set the font size of the panorama item header once so it can be used for all item headers in my app?

推荐答案

目前还没有办法为应用中的所有标头自动执行此操作.您需要为每个样式设置样式.

There isn't a way to automatically do it for all headers in your app yet. You'll need to set the style for each one.

隐式样式将在 Mango 更新中出现,届时应该可以做到这一点.

Implicit styling is coming in the Mango update and that should allow this to be done then.

更新
这是您现在可以执行的操作.

Update
Here's what you can do now.

为您想要的 FontSzie 创建一个全局模板样式.类似的东西:

Create a global template style for the FontSzie you want. Something like:

<Application.Resources>
    <DataTemplate x:Key="MyItemHeaderTemplate">
        <Grid>
            <ContentPresenter>
                <TextBlock Text="{Binding}" FontSize="20" />
            </ContentPresenter>
        </Grid>
    </DataTemplate>
</Application.Resources>

然后在我希望以这种方式设置样式的每个 PanoramaItem 中,我设置了 HeaderTemplate:

Then in every PanoramaItem that I wish to have styled this way I set the HeaderTemplate:

<controls:PanoramaItem Header="first" HeaderTemplate="{StaticResource MyItemHeaderTemplate}">
    // ...
</controls:PanoramaItem>

这篇关于如何更改全景项目标题的字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆