Remove background ContentDialog UWP

Anderson Rodrigues Cavalcante 316 Reputation points
2023-09-12T22:19:18.8033333+00:00

Hi, I'm trying to remove the opacity of the background behind the Content Dialog. How can I do that? See the Button and Text are with opacity because the Content Dialog.

User's image

Developer technologies Universal Windows Platform (UWP)
Developer technologies XAML
Developer technologies C#
0 comments No comments
{count} votes

Accepted answer
  1. Junjie Zhu - MSFT 21,646 Reputation points
    2023-09-13T02:17:35.0166667+00:00

    Hello @Anderson Rodrigues Cavalcante , Welcome to Microsoft Q&A!

    You can modify the key resource SystemControlPageBackgroundMediumAltMediumBrush and modify the first two digits of the color "#FFFFFFFF" to change the transparency.

    <Application
        x:Class="ContentDialogTest.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:ContentDialogTest">
        
    
        <Application.Resources>
            <ResourceDictionary>
                <ResourceDictionary.ThemeDictionaries>
                    <ResourceDictionary x:Key="Default">
                        <SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="#FFFFFFFF" />
                    </ResourceDictionary>
                    <ResourceDictionary x:Key="Dark">
                        <SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="#FF000000" />
                    </ResourceDictionary>
                </ResourceDictionary.ThemeDictionaries>
            </ResourceDictionary>
        </Application.Resources>
        
    </Application>
    

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.