Skip to content

Commit

Permalink
Update SystemBackdropsSample
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Sep 9, 2023
1 parent 97afe68 commit 05d2c80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WindowsSystemDispatcherQueueHelper m_wsdqHelper; // See separate sample below fo
Microsoft.UI.Composition.SystemBackdrops.MicaController m_micaController;
Microsoft.UI.Composition.SystemBackdrops.SystemBackdropConfiguration m_configurationSource;

bool TrySetMicaBackdrop()
bool TrySetMicaBackdrop(bool useMicaAlt)
{
if (Microsoft.UI.Composition.SystemBackdrops.MicaController.IsSupported())
{
Expand All @@ -24,6 +24,8 @@ bool TrySetMicaBackdrop()

m_micaController = new Microsoft.UI.Composition.SystemBackdrops.MicaController();

m_micaController.Kind = useMicaAlt ? Microsoft.UI.Composition.SystemBackdrops.MicaKind.BaseAlt : Microsoft.UI.Composition.SystemBackdrops.MicaKind.Base;

// Enable the system backdrop.
// Note: Be sure to have "using WinRT;" to support the Window.As<...>() call.
m_micaController.AddSystemBackdropTarget(this.As<Microsoft.UI.Composition.ICompositionSupportsSystemBackdrop>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WindowsSystemDispatcherQueueHelper m_wsdqHelper; // See separate sample below fo
Microsoft.UI.Composition.SystemBackdrops.DesktopAcrylicController m_acrylicController;
Microsoft.UI.Composition.SystemBackdrops.SystemBackdropConfiguration m_configurationSource;

bool TrySetAcrylicBackdrop()
bool TrySetAcrylicBackdrop(bool useAcrylicThin)
{
if (Microsoft.UI.Composition.SystemBackdrops.DesktopAcrylicController.IsSupported())
{
Expand All @@ -24,6 +24,8 @@ bool TrySetAcrylicBackdrop()

m_acrylicController = new Microsoft.UI.Composition.SystemBackdrops.DesktopAcrylicController();

m_acrylicController.Kind = useAcrylicThin ? Microsoft.UI.Composition.SystemBackdrops.DesktopAcrylicKind.Thin : Microsoft.UI.Composition.SystemBackdrops.DesktopAcrylicKind.Base;

// Enable the system backdrop.
// Note: Be sure to have "using WinRT;" to support the Window.As<...>() call.
m_acrylicController.AddSystemBackdropTarget(this.As<Microsoft.UI.Composition.ICompositionSupportsSystemBackdrop>());
Expand Down

0 comments on commit 05d2c80

Please sign in to comment.