Skip to content

Conversation

@godlytalias
Copy link

This is the API Spec for the proposed SystemBackdropHost control for supporting Acrylic effect in WinUI3 for controls other than Window & Flyouts

PR Type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Description

Current Behavior

New Behavior

Motivation and Context

How Has This Been Tested?

  • I have performed a self-review of my own code
  • I have added tests to cover my changes

Screenshots (if appropriate):

Spec for the SystemBackdropHost control
Updated the documentation for SystemBackdropHost to improve clarity and consistency. Adjusted wording for better readability and fixed minor grammatical issues.
Revised the background section to clarify the limitations of hosting system backdrops in WinUI3 compared to WinUI2, and improved the explanation of the `SystemBackdropHost` control.
Updated spec notes and clarified usage instructions for SystemBackdropHost.
Clarified limitations of SystemBackdrop in WinUI3 compared to WinUI2 and improved wording for better understanding.
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Oct 14, 2025

# Background

There are some System backdrop materials such as Mica, Acrylic etc that are available in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any other material effects other than Mica or Acrylic is available in Microsoft.UI.Xaml.Media.SystemBackdrop? if no, just remove etc and some words.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will reword this. We would support Mica, Acrylic and if someone creates a custom backdrop class as well deriving from SystemBackdrop as well

var host = new SystemBackdropHost
{
SystemBackdrop = new MicaBackdrop(),
CornerRadius = new CornerRadius(12)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do developers have to set this explicitly always? Or if not mentioned you would default this value?

Copy link
Author

@godlytalias godlytalias Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we will default to the value of 0 similar to the default control behaviors, https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.control.cornerradius?view=windows-app-sdk-1.8#microsoft-ui-xaml-controls-control-cornerradius
If some CornerRadius is kept on parent container, SystemBackdropHost would get clipped to that as well.


## SystemBackdropHost.CornerRadius property

Gets or sets the `CornerRadius` applied to the hosted backdrop surface. The default value is `CornerRadius(0)`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it automatically pick up the corner radius from current Windows (controls) settings rather than defaulting to 0?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usage of this API should be as simple as setting a background for the element. It can't be done as a brush as it was with UWP I understand, so the shape and geometry of the object that the property is added to, would be the best way to define it IMO.

It would probably render on top of any background for the element I would imagine, so the background is ignored or could be treated like a fallback, but the SystemBackdrop already has fallback and inactive behaviours.

I would imagine the border brush of the element would render on top of the system backdrop, unless the background sizing behaviour specifies otherwise.

Copy link
Author

@godlytalias godlytalias Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AjitSurana Default CornerRadius of 0 is in alignment with other controls, https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.control.cornerradius?view=windows-app-sdk-1.8#microsoft-ui-xaml-controls-control-cornerradius

@mdtauk We didn't go in the route of exposing it as similar to 'Background' property for each controls, because that would add overhead of adding a 'container' for each control to hold the 'PlacementVisual' from 'ContentExternalBackdropLink' which renders the acrylic. This would be an independent control which gets added to a container, it would take the size of the container and applies the backdrop to that area. So, It would render on top of any background for the container element, Border brush of the container would render outside the SystemBackdropHost area and would be visible

@godlytalias godlytalias changed the title [API Spec] SystemBackdropHost: WinUI3 Acrylic Support [API Spec] SystemBackdropHost: WinUI3 Background Acrylic Support Oct 15, 2025
@Gaoyifei1011
Copy link

Gaoyifei1011 commented Oct 18, 2025

After the official release of SystemBackdropHost, can WinUI 3 add SystemBackdrop in some pop-up Windows to maintain the consistency of the background color of WinUI 3 and WinUI 2 controls? For example: TeachingTip, ToolTip, Commandbar SecondaryCommands, Combobox popup menu, etc... @godlytalias @AjitSurana

@HO-COOH
Copy link

HO-COOH commented Oct 20, 2025

This sounds like only the first step required to support a truly UWP-like acrylic-based popup. To fix the existing issues, developer effort still seems necessary to manually rewrite existing ControlTemplate.

It's better to just fix all those issues by updating all those existing controls' ControlTemplate so that no developer effort is needed.

@godlytalias
Copy link
Author

godlytalias commented Oct 23, 2025

This sounds like only the first step required to support a truly UWP-like acrylic-based popup. To fix the existing issues, developer effort still seems necessary to manually rewrite existing ControlTemplate.

It's better to just fix all those issues by updating all those existing controls' ControlTemplate so that no developer effort is needed.

@HO-COOH Thanks for the response, If we update the template of all controls, that would hit hard on the fundamentals as we would be creating containers to hold the placementVisual and the usage of systembackdrop is not justifying to do such a change. Hence we decided to go with a control which developer can easily add to the place wherever they need to have a backdrop.

@ghost1372
Copy link
Contributor

@godlytalias Can we use it in next release? (v2.0-exp2)

@godlytalias
Copy link
Author

@godlytalias Can we use it in next release? (v2.0-exp2)

@ghost1372 Yes it will be available in exp2 release

@HO-COOH
Copy link

HO-COOH commented Oct 27, 2025

@HO-COOH Thanks for the response, If we update the template of all controls, that would hit hard on the fundamentals as we would be creating containers to hold the placementVisual and the usage of systembackdrop is not justifying to do such a change. Hence we decided to go with a control which developer can easily add to the place wherever they need to have a backdrop.

@godlytalias If that's the case, is there any difference between this and my AcrylicVisual? My existing solution to all these issues also works by finding a place (create one, usually a container if no suitable place), add this acrylic visual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-triage Issue needs to be triaged by the area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants