我正在使用 VS2015 开发 UWP Win10 应用程序。我正在使用 ContenDialog 显示模态窗口/弹出窗口。我需要更改 ContentDialog 的背景叠加颜色。这个怎么做。即使在内部样式中也没有选项/属性。
我需要将覆盖白色暗淡颜色更改为其他颜色,例如黑色覆盖/暗淡颜色等......
看图片。
要设置的关键资源是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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)