FancyZonesPreviewControl.xaml
1 <UserControl 2 x:Class="Microsoft.PowerToys.Settings.UI.Controls.FancyZonesPreviewControl" 3 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 4 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 5 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 6 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 7 Loaded="FancyZonesPreviewControl_Loaded" 8 RequestedTheme="Dark" 9 mc:Ignorable="d"> 10 <UserControl.Resources> 11 <ResourceDictionary> 12 <ResourceDictionary.ThemeDictionaries> 13 <ResourceDictionary x:Key="Dark"> 14 <SolidColorBrush x:Key="SolidBackgroundBrush" Color="Black" /> 15 <SolidColorBrush x:Key="SolidZoneNumberBrush" Color="White" /> 16 </ResourceDictionary> 17 <ResourceDictionary x:Key="Light"> 18 <SolidColorBrush x:Key="SolidBackgroundBrush" Color="White" /> 19 <SolidColorBrush x:Key="SolidZoneNumberBrush" Color="Black" /> 20 </ResourceDictionary> 21 <ResourceDictionary x:Key="HighContrast"> 22 <SolidColorBrush x:Key="SolidBackgroundBrush" Color="Black" /> 23 <SolidColorBrush x:Key="SolidZoneNumberBrush" Color="White" /> 24 </ResourceDictionary> 25 </ResourceDictionary.ThemeDictionaries> 26 <SolidColorBrush x:Key="DefaultAccentBrush" Color="{ThemeResource SystemAccentColor}" /> 27 <SolidColorBrush x:Key="DefaultBorderBrush" Color="{ThemeResource SystemAccentColor}" /> 28 </ResourceDictionary> 29 </UserControl.Resources> 30 31 <Grid 32 x:Name="RootGrid" 33 MinWidth="170" 34 MinHeight="86" 35 HorizontalAlignment="Center" 36 Background="Black" 37 BorderBrush="Black" 38 BorderThickness="8" 39 CornerRadius="12"> 40 <Grid.RowDefinitions> 41 <RowDefinition Height="*" /> 42 <RowDefinition Height="*" /> 43 </Grid.RowDefinitions> 44 <Grid.ColumnDefinitions> 45 <ColumnDefinition Width="*" /> 46 <ColumnDefinition Width="*" /> 47 </Grid.ColumnDefinitions> 48 <Border 49 Grid.RowSpan="2" 50 Grid.ColumnSpan="2" 51 CornerRadius="4" 52 Opacity="0.8"> 53 <Image 54 AutomationProperties.AccessibilityView="Raw" 55 Source="{x:Bind WallpaperPath, Mode=OneWay}" 56 Stretch="UniformToFill" /> 57 </Border> 58 59 <Border 60 x:Name="Zone1" 61 Grid.RowSpan="2" 62 Margin="4,4,2,4" 63 Background="{ThemeResource SystemControlAcrylicElementBrush}" 64 BorderThickness="1" 65 CornerRadius="2"> 66 <TextBlock 67 x:Name="Zone1Number" 68 HorizontalAlignment="Center" 69 VerticalAlignment="Center" 70 FontWeight="SemiBold" 71 Text="1" 72 Visibility="{x:Bind ShowZoneNumber, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" /> 73 </Border> 74 <Border 75 x:Name="Zone2" 76 Grid.Column="1" 77 Margin="2,4,4,2" 78 Background="{ThemeResource SystemControlAcrylicElementBrush}" 79 BorderThickness="1" 80 CornerRadius="2"> 81 <TextBlock 82 x:Name="Zone2Number" 83 HorizontalAlignment="Center" 84 VerticalAlignment="Center" 85 FontWeight="SemiBold" 86 Text="2" 87 Visibility="{x:Bind ShowZoneNumber, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" /> 88 </Border> 89 <Border 90 x:Name="Zone3" 91 Grid.Row="1" 92 Grid.Column="1" 93 Margin="2,2,4,4" 94 Background="{ThemeResource SystemControlAcrylicElementBrush}" 95 BorderThickness="1" 96 CornerRadius="2"> 97 <TextBlock 98 x:Name="Zone3Number" 99 HorizontalAlignment="Center" 100 VerticalAlignment="Center" 101 FontWeight="SemiBold" 102 Text="3" 103 Visibility="{x:Bind ShowZoneNumber, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" /> 104 </Border> 105 <VisualStateManager.VisualStateGroups> 106 <VisualStateGroup x:Name="CommonStates"> 107 <VisualState x:Name="Normal" /> 108 <VisualState x:Name="Disabled"> 109 <VisualState.Setters> 110 <Setter Target="RootGrid.Opacity" Value="0.4" /> 111 </VisualState.Setters> 112 </VisualState> 113 </VisualStateGroup> 114 </VisualStateManager.VisualStateGroups> 115 </Grid> 116 </UserControl>