c# - 如何在 Windows Phone 8.1 中更改内容对话框的标题样式

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

XAML:

<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 中显示的文本样式吗?

编辑

如果未提及 title,如何减少 ContentDialog 中最顶部的空白区域?

最佳答案

标题将显示在 ContentDialog 的 TitleTemplate 中.您可以根据需要更改它。

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

https://stackoverflow.com/questions/28292242/

相关文章:

interface - 用 UML 表示/说明两个独立程序之间的通信?

html - 如何向 erb 中的字符串添加空格?

jakarta-ee - 如何进行 payara netbeans 集成

jsf - 在 Facelets 中有条件地添加 HTML 元素属性

xml - 使用 XSD 验证 XML 中的自定义日期和时间

android - 为警报对话框项设置自定义字体的字体

apache-storm - Storm 用户界面不工作

Python3 - 字符串的最后一个字符

python - 如何在 Django 中用阿拉伯字符创建 slug?

scala - Scala 中 N 的三和