Browse Source

Added Mica enum value to WindowTransparencyLevel.cs
Added Mica as selected option

Adir 4 years ago
parent
commit
e61147edc1

+ 1 - 0
samples/ControlCatalog/MainView.xaml

@@ -98,6 +98,7 @@
             <ComboBoxItem>Transparent</ComboBoxItem>
             <ComboBoxItem>Blur</ComboBoxItem>
             <ComboBoxItem>AcrylicBlur</ComboBoxItem>
+            <ComboBoxItem>Mica</ComboBoxItem>
           </ComboBox>
           <ComboBox Items="{Binding WindowStates}" SelectedItem="{Binding WindowState}" />
         </StackPanel>

+ 1 - 0
samples/ControlCatalog/MainWindow.xaml

@@ -12,6 +12,7 @@
         ExtendClientAreaTitleBarHeightHint="{Binding TitleBarHeight}"
         TransparencyLevelHint="{Binding TransparencyLevel}"        
         x:Name="MainWindow"
+        Background="Transparent"
         x:Class="ControlCatalog.MainWindow" WindowState="{Binding WindowState, Mode=TwoWay}">
   <NativeMenu.Menu>
     <NativeMenu>

+ 1 - 0
samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml

@@ -14,6 +14,7 @@
       <ComboBoxItem>Transparent</ComboBoxItem>
       <ComboBoxItem>Blur</ComboBoxItem>
       <ComboBoxItem>AcrylicBlur</ComboBoxItem>
+      <ComboBoxItem>Mica</ComboBoxItem>
     </ComboBox>
   </StackPanel>
 </UserControl>

+ 6 - 1
src/Avalonia.Controls/WindowTransparencyLevel.cs

@@ -20,6 +20,11 @@
         /// <summary>
         /// The window background is a blur-behind with a high blur radius. This level may fallback to Blur.
         /// </summary>
-        AcrylicBlur
+        AcrylicBlur,
+        
+        /// <summary>
+        /// The window background is based on desktop wallpaper tint with a blur. This will only work on Windows 11 
+        /// </summary>
+        Mica
     }
 }