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

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

问题描述

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

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>

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

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