删除MessagePrompt中的边框

时间:2012-08-27 12:31:31

标签: windows-phone-7 xaml border

我正在使用Coding4Fun提示消息在WP7(Windows Phone 7)上显示弹出消息。

我搜索了如何删除邮件提示周围的白色边框,我找到了以下内容

How to remove the border in Coding4Fun MessagePrompt

我想执行解决方案,但我不知道在哪里放置XAML代码。

请问任何人澄清答案吗?

提前致谢。

1 个答案:

答案 0 :(得分:2)

您可以将其显式为<phone:PhoneApplicationPage>的孩子。

给出的例子:

<phone:PhoneApplicationPage x:Class="Your.Class"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    Some other namespace declarations >

    <!-- Your page resources dictionary -->
    <phone:PhoneApplicationPage.Resources>  
        <ControlTemplate x:Key="MsgPropmtNoBorder"
                         TargetType="c4f:MessagePrompt">
                 BLAH-BLAH-BLAH
        </ControlTemplate>
    </phone:PhoneApplicationPage.Resources>

    <!-- Your layout root and all the page content -->
    <Grid x:Name="LayoutRoot"
          Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        BLAH-BLAH-BLAH-YOUR-CONTENT

    </Grid>
</phone:PhoneApplicationPage>