Skip to content

Commit

Permalink
Add Missing Sample for Desktop Acrylic
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Sep 9, 2023
1 parent 05d2c80 commit 41df384
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions WinUIGallery/ControlPages/SystemBackdropsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<Button Click="createBuiltInAcrylicWindow_Click">Create Window with built-in Acrylic</Button>
</local:ControlExample>

<local:ControlExample HeaderText="Create a window with a customizable Desktop Acrylic system backdrop."
CSharpSource="SystemBackdrops\SystemBackdropsSample2.txt">
<Button Click="createCustomDesktopAcrylicWindow_Click">Create Window with customizable Desktop Acrylic</Button>
</local:ControlExample>

<local:ControlExample HeaderText="Helper class to ensure a Windows.System.DispatcherQueue exists."
CSharpSource="SystemBackdrops\SystemBackdropsEnsureSystemDQC.txt">
<TextBlock Text="A Windows.System.DispatcherQueue must exist on the thread to use MicaController or DesktopAcrylicController. This helper class exposes and uses the underlying create function." TextWrapping="WrapWholeWords" />
Expand Down
7 changes: 7 additions & 0 deletions WinUIGallery/ControlPages/SystemBackdropsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,12 @@ private void createBuiltInAcrylicWindow_Click(object sender, RoutedEventArgs e)
newWindow.SetBackdrop(AppUIBasics.SamplePages.SampleSystemBackdropsWindow.BackdropType.DesktopAcrylicBase);
newWindow.Activate();
}

private void createCustomDesktopAcrylicWindow_Click(object sender, RoutedEventArgs e)
{
var newWindow = new AppUIBasics.SamplePages.SampleSystemBackdropsWindow();
newWindow.SetBackdrop(AppUIBasics.SamplePages.SampleSystemBackdropsWindow.BackdropType.DesktopAcrylicBase);
newWindow.Activate();
}
}
}

0 comments on commit 41df384

Please sign in to comment.