【发布时间】:2015-09-06 10:18:09
【问题描述】:
我正在为 Windows Phone 8.1(Windows RT 应用程序)开发一个应用程序。 我想显示一个带有白色边框的 ContentDialog,我可以看到对话框,但我看不到其中的任何边框。 我已经为它定义了我自己的 xaml,因为我经常使用这个对话框并且我想在一个地方有通用的设置。 这是 XAML:
<ContentDialog
x:Class="MyNamespace.MyDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Margin="10,330,10,0"
Height="200"
Width="340"
Padding="10"
Background="Black"
BorderBrush="White"
BorderThickness="10">
</ContentDialog>
我在代码 (c#) 中使用它,如下所示:
mPopup = new MyDialog()
{
Title = "",
Content = "Hello World",
PrimaryButtonText = "OK",
IsSecondaryButtonEnabled = false,
};
mPopup.ShowAsync();
我也尝试从 cs 设置边框属性,但没有任何运气。 根据 MSDN 文档,您可以为 ContentDialog 指定 BorderBrush 和 BorderThickness。 我在这里错过了什么?
【问题讨论】:
标签: c# xaml windows-phone-8.1