-
Notifications
You must be signed in to change notification settings - Fork 707
[ADD] SystemBackdropHost Control Sample Page #2079
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?
[ADD] SystemBackdropHost Control Sample Page #2079
Conversation
@microsoft-github-policy-service agree company="Microsoft" |
|
@rashmi-thakurr Exciting to see this new feature land :)! The |
| </ComboBox> | ||
| <Slider x:Name="CornerRadiusSlider" Header="Corner Radius" Maximum="50" Minimum="0" StepFrequency="1" Value="8" ValueChanged="CornerRadiusSlider_ValueChanged" /> | ||
| <TextBlock> | ||
| <Run Text="Current Radius: " /> |
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.
| <Run Text="Current Radius: " /> | |
| <Run Text="Current radius: " /> |
| "Subtitle": "A control to host system backdrop materials.", | ||
| "ImagePath": "ms-appx:///Assets/ControlImages/Acrylic.png", | ||
| "Description": "SystemBackdropHost allows you to apply system backdrop materials to specific UI elements.", | ||
| "Description": "SystemBackdropHost is developed to enable seamless Acrylic effects for individual surfaces and controls in WinUI3 apps. This control allows developers to easily apply system backdrops (like Acrylic and Mica) anywhere in their app UI.", |
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.
SystemBackdropHost enables applying Mica and Acrylic to individual UI elements within an app experience, extending these materials beyond the window background for more flexible and immersive designs.
| <DesktopAcrylicBackdrop /> | ||
| </SystemBackdropHost.SystemBackdrop> | ||
| </SystemBackdropHost> | ||
| <Button Content="Click Me" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
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.
| <Button Content="Click Me" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |
| <Button Content="Button" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
| <MicaBackdrop Kind="Base" /> | ||
| </SystemBackdropHost.SystemBackdrop> | ||
| </SystemBackdropHost> | ||
| <Button Content="Click Me" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
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.
| <Button Content="Click Me" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |
| <Button Content="Button" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
| <MicaBackdrop Kind="BaseAlt" /> | ||
| </SystemBackdropHost.SystemBackdrop> | ||
| </SystemBackdropHost> | ||
| <Button Content="Click Me" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
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.
| <Button Content="Click Me" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |
| <Button Content="Button" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
| <ComboBoxItem Content="Mica" Tag="Mica" /> | ||
| <ComboBoxItem Content="Mica Alt" Tag="MicaAlt" /> | ||
| </ComboBox> | ||
| <Slider x:Name="CornerRadiusSlider" Header="Corner Radius" Maximum="50" Minimum="0" StepFrequency="1" Value="8" ValueChanged="CornerRadiusSlider_ValueChanged" /> |
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.
| <Slider x:Name="CornerRadiusSlider" Header="Corner Radius" Maximum="50" Minimum="0" StepFrequency="1" Value="8" ValueChanged="CornerRadiusSlider_ValueChanged" /> | |
| <Slider x:Name="CornerRadiusSlider" Header="Corner radius" Maximum="50" Minimum="0" StepFrequency="1" Value="8" ValueChanged="CornerRadiusSlider_ValueChanged" /> |
| <ComboBoxItem Content="Mica Alt" Tag="MicaAlt" /> | ||
| </ComboBox> | ||
| <Slider x:Name="CornerRadiusSlider" Header="Corner Radius" Maximum="50" Minimum="0" StepFrequency="1" Value="8" ValueChanged="CornerRadiusSlider_ValueChanged" /> | ||
| <TextBlock> |
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.
For the sake of simplicity, do we need to plot the value? Why not just the slider?
| } | ||
| } | ||
|
|
||
| private void CornerRadiusSlider_ValueChanged(object sender, Microsoft.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e) |
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.
This makes the code cleaner and more consistent with the rest of the file. 🙂
| private void CornerRadiusSlider_ValueChanged(object sender, Microsoft.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e) | |
| private void CornerRadiusSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) |
| "Subtitle": "A control to host system backdrop materials.", | ||
| "ImagePath": "ms-appx:///Assets/ControlImages/Acrylic.png", | ||
| "Description": "SystemBackdropHost allows you to apply system backdrop materials to specific UI elements.", | ||
| "Description": "SystemBackdropHost is developed to enable seamless Acrylic effects for individual surfaces and controls in WinUI3 apps. This control allows developers to easily apply system backdrops (like Acrylic and Mica) anywhere in their app UI.", |
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.
Nit: For consistency, use "WinUI 3" instead of "WinUI3".
| "ApiNamespace": "Microsoft.UI.Xaml.Controls", | ||
| "Subtitle": "A control to host system backdrop materials.", | ||
| "ImagePath": "ms-appx:///Assets/ControlImages/Acrylic.png", | ||
| "Description": "SystemBackdropHost allows you to apply system backdrop materials to specific UI elements.", |
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.
May be better to mention 'specific area inside the UI tree' as we are not applying backdrop directly to ui elements
Description
Adds Samples for SystemBackdropHost Control
Motivation and Context
Provides a clearer example of how to use SystemBackdropHost. Helps developers understand and test the newer backdrop APIs.
How Has This Been Tested?
Tested in WinUI Gallery on Windows 11. Verified backdrop switching, CornerRadius updates, and sample loading without errors in Debug and Release.
Screenshots (if appropriate):
Types of changes