Quero alterar a transparência da sobreposição exibida na janela pai quando o ContentDialog estiver aberto. Estou usando o WinUI 3. Dei uma olhada no generic.xaml e tentei alterar algumas coisas, mas não houve efeito algum.
Modifiquei o código a seguir, mas não vi nenhum resultado.
<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>
Tente o seguinte no
Opened
evento:Você pode aprender mais sobre isso
SmokeLayerBacground
no arquivo generic.xaml .FindAscendant()
vem do pacote CommunityToolkit.WinUI.Extensions NuGet.