如何在 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>
关于c# - 如何在 Windows Phone 8.1 中更改内容对话框的标题样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28292242/