如何更改ContentDialog uwp的背景覆盖

Zia*_*man 0 win-universal-app uwp-xaml

我正在使用 VS2015 开发 UWP Win10 应用程序。我正在使用 ContenDialog 显示模态窗口/弹出窗口。我需要更改 ContentDialog 的背景叠加颜色。这个怎么做。即使在内部样式中也没有选项/属性。

我需要将覆盖白色暗淡颜色更改为其他颜色,例如黑色覆盖/暗淡颜色等......

看图片。

在此输入图像描述

Chr*_*ler 5

要设置的关键资源是SystemControlPageBackgroundMediumAltMediumBrush

我使用以下主题定义来定位应用程序中的所有 ContentDialog:

<!--  override the Dialog Background  -->
<ResourceDictionary.ThemeDictionaries>
    <ResourceDictionary x:Key="Default">
        <SolidColorBrush x:Key="ContentDialogDimmingThemeBrush" Color="#99FFFFFF" />
        <SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="#99000000" />
        <StaticResource x:Key="ContentDialogLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
    </ResourceDictionary>
    <ResourceDictionary x:Key="Dark">
        <SolidColorBrush x:Key="ContentDialogDimmingThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" />
        <SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="#99000000" />
        <StaticResource x:Key="ContentDialogLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
    </ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
Run Code Online (Sandbox Code Playgroud)