Skip to content

Conversation

@rashmi-thakurr
Copy link
Collaborator

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):

Screenshot 2025-11-19 152224

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@rashmi-thakurr
Copy link
Collaborator Author

@rashmi-thakurr please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree company="Microsoft"

@niels9001
Copy link
Collaborator

@rashmi-thakurr Exciting to see this new feature land :)!

The main branch is used for the latest stable release. Therefore, this PR should merge into: the 2.0 branch. Once 2.0 hits stable we will then merge that branch into main

</ComboBox>
<Slider x:Name="CornerRadiusSlider" Header="Corner Radius" Maximum="50" Minimum="0" StepFrequency="1" Value="8" ValueChanged="CornerRadiusSlider_ValueChanged" />
<TextBlock>
<Run Text="Current Radius: " />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<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.",
Copy link
Collaborator

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"/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<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"/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<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"/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<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" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<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>
Copy link
Collaborator

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)
Copy link
Contributor

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. 🙂

Suggested change
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.",
Copy link
Contributor

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.",
Copy link
Contributor

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants