-
Couldn't load subscription status.
- Fork 773
[API Spec] SystemBackdropHost: WinUI3 Background Acrylic Support #10833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
|
|
||
| # Background | ||
|
|
||
| There are some System backdrop materials such as Mica, Acrylic etc that are available in |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)`. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
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 |
|
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 It's better to just fix all those issues by updating all those existing controls' |
@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 |
|
@godlytalias Can we use it in next release? (v2.0-exp2) |
@ghost1372 Yes it will be available in exp2 release |
@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. |
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:
Description
Current Behavior
New Behavior
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):