首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Windows 8.1中更改内容对话框的标题样式

问如何在Windows 8.1中更改内容对话框的标题样式
EN

Stack Overflow用户
提问于 2015-02-03 05:53:38
回答 1查看 2.8K关注 0票数 2

如何在Windows 8.1中更改title页面的ContentDialog属性样式。

XAML:

代码语言:javascript
复制
<ContentDialog
    x:Class="MyApp.View.Login.ContentDialog1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MyApp.View.Login"
    Title="DIALOG TITLE">

    <StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
        <TextBox Name="email" Header="Email address"/>
    </StackPanel>
</ContentDialog>

这里有Title="DIALOG TITLE",我可以更改title中的文本显示样式吗?

编辑

​

​

如果不提ContentDialog,如何减少title中最上层的空空间?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-02-03 06:14:00

标题将显示在内容对话框的TitleTemplate中。你可以根据需要改变它。

代码语言:javascript
复制
<ContentDialog
    x:Class="MyApp.View.Login.ContentDialog1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MyApp.View.Login"
    Title="DIALOG TITLE">

    <ContentDialog.TitleTemplate>
        <DataTemplate>
            <!-- what do you want the title to look like -->
        </DataTemplate>
    </ContentDialog.TitleTemplate>

    <StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
        <TextBox Name="email" Header="Email address"/>
    </StackPanel>
</ContentDialog>
票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28292242

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档