How to change the popup screen background color?

Sowndarrajan Vijayaragavan 310 Reputation points
2023-06-06T10:11:04.42+00:00

User's image

Background color i need to change to Black....

In the above example it is white i need to set to black

I am using CommunityToolkit.Maui for popup

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,844 questions
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 68,016 Reputation points Microsoft Vendor
    2023-06-07T05:14:40.4+00:00

    Hello,

    CommunityToolkit popup do not have this feature, you can add feature request in the CommunityToolkit GitHub page

    Based on your screenshot, if you want to change the popup page's outside color to black for the windows platform. Here is a way to change it. Firstly, please open App.xaml in Platforms/Windows/Windows/App.xaml path.

    Then copy content about <maui:MauiWinUIApplication.Resources> to <maui:MauiWinUIApplication> tag like following code, then you can set popup page's outside color to black

    <maui:MauiWinUIApplication
    ...   
    >
        <maui:MauiWinUIApplication.Resources>
           
           <SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="{StaticResource SystemAltMediumColor}" />
    
           <Color x:Key="SystemAltMediumColor">#ff000000</Color>
    
    
        </maui:MauiWinUIApplication.Resources>
    </maui:MauiWinUIApplication>
    

    Best Regards,

    Leon Lu


    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.


0 additional answers

Sort by: Most helpful