如何在 Windows Phone 8.1 中更改内容对话框的标题样式
How to change style of title of Content Dialog in 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
中最上面的空 space?
标题将显示在 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>
如何在 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
中最上面的空 space?
标题将显示在 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>