我想更改 ContentDialog 打开时父窗口上显示的覆盖层的透明度。我使用的是 WinUI 3。我查看了 generic.xaml 并尝试更改了一些内容,但没有任何效果。
我修改了下面的代码,但没有看到任何结果。
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
<SolidColorBrush x:Key="ContentDialogBackgroundThemeBrush" Color="Red" />
<SolidColorBrush x:Key="ContentDialogBorderThemeBrush" Color="Red" />
<SolidColorBrush x:Key="ContentDialogContentForegroundBrush" Color="Red" />
<SolidColorBrush x:Key="ContentDialogDimmingThemeBrush" Color="Red" />
<SolidColorBrush x:Key="SystemControlPageBackgroundBaseMediumBrush" Color="red" />
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="red" />
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="ContentDialogDimmingThemeBrush" Color="Red" />
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="Red" />
<StaticResource x:Key="ContentDialogLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="ContentDialogDimmingThemeBrush" Color="Red" />
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="Red" />
<StaticResource x:Key="ContentDialogLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Application.Resources>