[FancyZonesEditor] XamlStyler formatting (#29126)

This commit is contained in:
Davide Giacometti
2023-10-11 12:34:06 +02:00
committed by GitHub
parent ad392290bd
commit 5d669df21a
23 changed files with 1312 additions and 1249 deletions

View File

@@ -107,7 +107,7 @@ if (-not $Passive)
else else
{ {
Write-Output "Checking all files (passively)" Write-Output "Checking all files (passively)"
$files = Get-ChildItem -Path "$PSScriptRoot\..\src\*.xaml" -Recurse | Select-Object -ExpandProperty FullName | Where-Object { $_ -notmatch "(\\obj\\)|(\\bin\\)|(\\x64\\)|(\\launcher\\PowerLauncher\\)|(\\launcher\\Wox.Plugin\\)|(\\colorPicker\\ColorPickerUI\\)|(\\editor\\FancyZonesEditor\\)|(\\settings-ui\\Settings.UI\\)" } $files = Get-ChildItem -Path "$PSScriptRoot\..\src\*.xaml" -Recurse | Select-Object -ExpandProperty FullName | Where-Object { $_ -notmatch "(\\obj\\)|(\\bin\\)|(\\x64\\)|(\\launcher\\PowerLauncher\\)|(\\launcher\\Wox.Plugin\\)|(\\colorPicker\\ColorPickerUI\\)|(\\settings-ui\\Settings.UI\\)" }
if ($files.count -gt 0) if ($files.count -gt 0)
{ {

View File

@@ -1,10 +1,11 @@
<Application x:Class="FancyZonesEditor.App" <Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.App"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:local="clr-namespace:FancyZonesEditor"
Startup="OnStartup" xmlns:ui="http://schemas.modernwpf.com/2019"
Exit="OnExit"> Exit="OnExit"
Startup="OnStartup">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
@@ -15,7 +16,7 @@
<ResourceDictionary Source="pack://application:,,,/Styles/LayoutPreviewStyles.xaml" /> <ResourceDictionary Source="pack://application:,,,/Styles/LayoutPreviewStyles.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<Style x:Key="HeadingTextBlock" TargetType="TextBlock"/> <Style x:Key="HeadingTextBlock" TargetType="TextBlock" />
</ResourceDictionary> </ResourceDictionary>
</Application.Resources> </Application.Resources>
</Application> </Application>

View File

@@ -1,13 +1,15 @@
<UserControl x:Class="FancyZonesEditor.CanvasEditor" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.CanvasEditor"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="300" d:DesignWidth="300"> d:DesignHeight="300"
d:DesignWidth="300"
mc:Ignorable="d">
<Grid x:Name="Body"> <Grid x:Name="Body">
<Viewbox Stretch="Uniform"> <Viewbox Stretch="Uniform">
<Canvas x:Name="Preview"/> <Canvas x:Name="Preview" />
</Viewbox> </Viewbox>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -1,57 +1,63 @@
<local:EditorWindow x:Class="FancyZonesEditor.CanvasEditorWindow" <local:EditorWindow
AutomationProperties.Name="{x:Static props:Resources.Canvas_Layout_Editor}" x:Class="FancyZonesEditor.CanvasEditorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:props="clr-namespace:FancyZonesEditor.Properties" xmlns:props="clr-namespace:FancyZonesEditor.Properties"
mc:Ignorable="d" xmlns:ui="http://schemas.modernwpf.com/2019"
Title="" Title=""
Height="196" Height="196"
MinWidth="360" MinWidth="360"
BorderThickness="0" ui:TitleBar.IsIconVisible="False"
xmlns:ui="http://schemas.modernwpf.com/2019" ui:WindowHelper.UseModernWindowStyle="True"
ui:WindowHelper.UseModernWindowStyle="True" AutomationProperties.Name="{x:Static props:Resources.Canvas_Layout_Editor}"
ui:TitleBar.IsIconVisible="False" Background="{DynamicResource PrimaryBackgroundBrush}"
SizeToContent="Width" BorderThickness="0"
Background="{DynamicResource PrimaryBackgroundBrush}" Closed="OnClosed"
ResizeMode="NoResize" ContentRendered="EditorWindow_ContentRendered"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize"
ContentRendered="EditorWindow_ContentRendered" SizeToContent="Width"
Closed="OnClosed"> WindowStartupLocation="CenterOwner"
mc:Ignorable="d">
<Grid Height="160"> <Grid Height="160">
<Grid Height="36" <Grid
Background="{DynamicResource SecondaryBackgroundBrush}" Height="36"
Margin="0,-36,0,0" Margin="0,-36,0,0"
VerticalAlignment="Top" HorizontalAlignment="Stretch"
HorizontalAlignment="Stretch"> VerticalAlignment="Top"
<Border Background="{DynamicResource TitleBarSecondaryForegroundBrush}" Background="{DynamicResource SecondaryBackgroundBrush}">
Width="30" <Border
Height="3" Width="30"
CornerRadius="1.5" Height="3"
VerticalAlignment="Center" Margin="0,4,0,0"
Margin="0,4,0,0" /> VerticalAlignment="Center"
Background="{DynamicResource TitleBarSecondaryForegroundBrush}"
CornerRadius="1.5" />
</Grid> </Grid>
<StackPanel Margin="16" VerticalAlignment="Bottom" <StackPanel
FocusManager.FocusedElement="{Binding ElementName=newZoneButton}"> Margin="16"
VerticalAlignment="Bottom"
FocusManager.FocusedElement="{Binding ElementName=newZoneButton}">
<local:ClickAutomationEventButton x:Name="newZoneButton" <local:ClickAutomationEventButton
HorizontalAlignment="Stretch" x:Name="newZoneButton"
Height="64" Width="64"
Width="64" Height="64"
ui:ControlHelper.CornerRadius="64" Margin="0,8,0,0"
Margin="0,8,0,0" HorizontalAlignment="Stretch"
Style="{StaticResource AccentButtonStyle}" ui:ControlHelper.CornerRadius="64"
FontFamily="{StaticResource SymbolThemeFontFamily}" Click="OnAddZone"
Content="&#xE710;" Content="&#xE710;"
FontSize="24" DataContext="{Binding Path=Model, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
TabIndex="0" FontFamily="{StaticResource SymbolThemeFontFamily}"
ToolTip="{x:Static props:Resources.Add_zone}" FontSize="24"
DataContext="{Binding Path=Model, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" IsEnabled="{Binding IsZoneAddingAllowed}"
IsEnabled="{Binding IsZoneAddingAllowed}" OnClickAutomationValue="{x:Static props:Resources.New_zone_added}"
Click="OnAddZone" Style="{StaticResource AccentButtonStyle}"
OnClickAutomationValue="{x:Static props:Resources.New_zone_added}" /> TabIndex="0"
ToolTip="{x:Static props:Resources.Add_zone}" />
<Grid Margin="0,24,0,-4"> <Grid Margin="0,24,0,-4">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -59,17 +65,19 @@
<ColumnDefinition Width="8" /> <ColumnDefinition Width="8" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Content="{x:Static props:Resources.Cancel}" <Button
Style="{StaticResource DefaultButtonStyle}" Grid.Column="2"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Grid.Column="2" Click="OnCancel"
TabIndex="2" Content="{x:Static props:Resources.Cancel}"
Click="OnCancel" /> Style="{StaticResource DefaultButtonStyle}"
<Button Content="{x:Static props:Resources.Save_Apply}" TabIndex="2" />
Style="{StaticResource AccentButtonStyle}" <Button
TabIndex="1" HorizontalAlignment="Stretch"
HorizontalAlignment="Stretch" Click="OnSaveApplyTemplate"
Click="OnSaveApplyTemplate" /> Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="1" />
</Grid> </Grid>
</StackPanel> </StackPanel>
</Grid> </Grid>

View File

@@ -1,40 +1,47 @@
<UserControl x:Class="FancyZonesEditor.CanvasZone" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.CanvasZone"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:props="clr-namespace:FancyZonesEditor.Properties" xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" xmlns:props="clr-namespace:FancyZonesEditor.Properties"
KeyDown="Border_KeyDown" d:DesignHeight="450"
Background="Transparent" d:DesignWidth="800"
d:DesignHeight="450" d:DesignWidth="800"> Background="Transparent"
KeyDown="Border_KeyDown"
mc:Ignorable="d">
<UserControl.Resources> <UserControl.Resources>
<Style x:Key="CanvasZoneThumbStyle" TargetType="{x:Type Thumb}"> <Style x:Key="CanvasZoneThumbStyle" TargetType="{x:Type Thumb}">
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/> <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}"> <ControlTemplate TargetType="{x:Type Thumb}">
<Border x:Name="ThumbBorder" <Border
Opacity="0" x:Name="ThumbBorder"
CornerRadius="0" Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}" BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"> CornerRadius="0"
Opacity="0">
<VisualStateManager.VisualStateGroups> <VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates" > <VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions> <VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.15"> <VisualTransition GeneratedDuration="0:0:0.15">
<VisualTransition.GeneratedEasingFunction> <VisualTransition.GeneratedEasingFunction>
<ExponentialEase EasingMode="EaseInOut"/> <ExponentialEase EasingMode="EaseInOut" />
</VisualTransition.GeneratedEasingFunction> </VisualTransition.GeneratedEasingFunction>
</VisualTransition> </VisualTransition>
</VisualStateGroup.Transitions> </VisualStateGroup.Transitions>
<VisualState x:Name="Normal" /> <VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver"> <VisualState x:Name="MouseOver">
<Storyboard> <Storyboard>
<DoubleAnimation Storyboard.TargetName="ThumbBorder" Duration="0:0:0.15" Storyboard.TargetProperty="Opacity" To="1"/> <DoubleAnimation
Storyboard.TargetName="ThumbBorder"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0:0:0.15" />
</Storyboard> </Storyboard>
</VisualState> </VisualState>
</VisualStateGroup> </VisualStateGroup>
@@ -45,52 +52,39 @@
</Setter> </Setter>
</Style> </Style>
<Style x:Key="CloseButtonStyle" <Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
TargetType="{x:Type Button}"> <Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderThickness" <Setter Property="HorizontalContentAlignment" Value="Center" />
Value="1" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" <Setter Property="Foreground" Value="{DynamicResource PrimaryForegroundBrush}" />
Value="Center" /> <Setter Property="Padding" Value="1" />
<Setter Property="VerticalContentAlignment"
Value="Center" />
<Setter Property="Foreground"
Value="{DynamicResource PrimaryForegroundBrush}" />
<Setter Property="Padding"
Value="1" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type Button}"> <ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="border" <Border
BorderBrush="{TemplateBinding BorderBrush}" x:Name="border"
BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
SnapsToDevicePixels="true"> BorderThickness="{TemplateBinding BorderThickness}"
<ContentPresenter x:Name="contentPresenter" SnapsToDevicePixels="true">
Focusable="False" <ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" x:Name="contentPresenter"
Margin="{TemplateBinding Padding}" Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsDefaulted" <Trigger Property="IsDefaulted" Value="true">
Value="true"> <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource SystemControlBackgroundAccentBrush}" />
<Setter Property="BorderBrush"
TargetName="border"
Value="{DynamicResource SystemControlBackgroundAccentBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsMouseOver" <Trigger Property="IsMouseOver" Value="true">
Value="true"> <Setter TargetName="contentPresenter" Property="Opacity" Value="0.6" />
<Setter Property="Opacity"
TargetName="contentPresenter"
Value="0.6" />
</Trigger> </Trigger>
<Trigger Property="IsPressed" <Trigger Property="IsPressed" Value="true">
Value="true"> <Setter TargetName="contentPresenter" Property="Opacity" Value="0.4" />
<Setter Property="Opacity"
TargetName="contentPresenter"
Value="0.4" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
@@ -99,99 +93,182 @@
</Style> </Style>
</UserControl.Resources> </UserControl.Resources>
<Border CornerRadius="0" <Border
Focusable="True" x:Name="RootBorder"
x:Name="RootBorder" CornerRadius="0"
PreviewMouseDown="Border_PreviewMouseDown"> Focusable="True"
PreviewMouseDown="Border_PreviewMouseDown">
<Border.Style> <Border.Style>
<Style> <Style>
<Setter Property="Border.Background" <Setter Property="Border.Background" Value="{DynamicResource CanvasZoneBackgroundBrush}" />
Value="{DynamicResource CanvasZoneBackgroundBrush}" /> <Setter Property="Border.BorderBrush" Value="{DynamicResource CanvasZoneBorderBrush}" />
<Setter Property="Border.BorderBrush" <Setter Property="Border.BorderThickness" Value="1" />
Value="{DynamicResource CanvasZoneBorderBrush}" />
<Setter Property="Border.BorderThickness"
Value="1"/>
<Style.Triggers> <Style.Triggers>
<Trigger Property="Border.IsKeyboardFocused" <Trigger Property="Border.IsKeyboardFocused" Value="true">
Value="true"> <Setter Property="Border.BorderThickness" Value="4" />
<Setter Property="Border.BorderThickness" <Setter Property="Border.BorderBrush" Value="{DynamicResource SystemControlBackgroundAccentBrush}" />
Value="4" />
<Setter Property="Border.BorderBrush"
Value="{DynamicResource SystemControlBackgroundAccentBrush}" />
</Trigger> </Trigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</Border.Style> </Border.Style>
<Grid x:Name="Frame"> <Grid x:Name="Frame">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="8"/> <RowDefinition Height="8" />
<RowDefinition Height="16"/> <RowDefinition Height="16" />
<RowDefinition Height="*"/> <RowDefinition Height="*" />
<RowDefinition Height="16"/> <RowDefinition Height="16" />
<RowDefinition Height="8"/> <RowDefinition Height="8" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="8"/> <ColumnDefinition Width="8" />
<ColumnDefinition Width="16"/> <ColumnDefinition Width="16" />
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*" />
<ColumnDefinition Width="16"/> <ColumnDefinition Width="16" />
<ColumnDefinition Width="8"/> <ColumnDefinition Width="8" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<DockPanel HorizontalAlignment="Center" <DockPanel
VerticalAlignment="Center" Grid.Row="2"
Grid.Column="2" Grid.Column="2"
Grid.Row="2"> HorizontalAlignment="Center"
VerticalAlignment="Center">
<Label <Label
Name="LabelID" Name="LabelID"
DockPanel.Dock="Top"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Content="ID" Content="ID"
FontWeight="SemiBold" DockPanel.Dock="Top"
FontSize="64" FontSize="64"
FontWeight="SemiBold"
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}" /> Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}" />
<TextBlock FontSize="16" <TextBlock
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}" HorizontalAlignment="Center"
Opacity="0.6" VerticalAlignment="Center"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
FontWeight="SemiBold" FontSize="16"
HorizontalAlignment="Center" FontWeight="SemiBold"
VerticalAlignment="Center"> Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}"
<Run x:Name="WidthLabel" /> Opacity="0.6">
<Run Text="&#xE947;" <Run x:Name="WidthLabel" />
FontSize="10" <Run
FontFamily="{StaticResource SymbolThemeFontFamily}" /> FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="10"
Text="&#xE947;" />
<Run x:Name="HeightLabel" /> <Run x:Name="HeightLabel" />
</TextBlock> </TextBlock>
</DockPanel> </DockPanel>
<Thumb x:Name="Caption" Cursor="SizeAll" Background="Transparent" BorderThickness="3" Padding="4" Grid.Column="0" Grid.ColumnSpan="5" Margin="-1" Grid.Row="0" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="Caption_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> <Thumb
x:Name="Caption"
Grid.Row="0"
Grid.RowSpan="5"
Grid.Column="0"
Grid.ColumnSpan="5"
Margin="-1"
Padding="4"
Background="Transparent"
BorderThickness="3"
Cursor="SizeAll"
DragDelta="UniversalDragDelta"
DragStarted="Caption_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb x:Name="NResize" Cursor="SizeNS" BorderThickness="0,2,0,0" Grid.ColumnSpan="5" DragDelta="UniversalDragDelta" DragStarted="NResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> <Thumb
<Thumb x:Name="SResize" Cursor="SizeNS" BorderThickness="0,0,0,2" Grid.Row="4" Grid.ColumnSpan="5" DragDelta="UniversalDragDelta" DragStarted="SResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> x:Name="NResize"
<Thumb x:Name="WResize" Cursor="SizeWE" BorderThickness="2,0,0,0" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="WResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> Grid.ColumnSpan="5"
<Thumb x:Name="EResize" Cursor="SizeWE" BorderThickness="0,0,2,0" Grid.Column="4" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="EResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> BorderThickness="0,2,0,0"
Cursor="SizeNS"
DragDelta="UniversalDragDelta"
DragStarted="NResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="SResize"
Grid.Row="4"
Grid.ColumnSpan="5"
BorderThickness="0,0,0,2"
Cursor="SizeNS"
DragDelta="UniversalDragDelta"
DragStarted="SResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="WResize"
Grid.RowSpan="5"
BorderThickness="2,0,0,0"
Cursor="SizeWE"
DragDelta="UniversalDragDelta"
DragStarted="WResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="EResize"
Grid.RowSpan="5"
Grid.Column="4"
BorderThickness="0,0,2,0"
Cursor="SizeWE"
DragDelta="UniversalDragDelta"
DragStarted="EResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb x:Name="NWResize" Cursor="SizeNWSE" BorderThickness="2,2,0,0" Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2" DragDelta="UniversalDragDelta" DragStarted="NWResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> <Thumb
<Thumb x:Name="NEResize" Cursor="SizeNESW" BorderThickness="0,2,2,0" Grid.Row="0" Grid.Column="3" Grid.RowSpan="2" Grid.ColumnSpan="2" DragDelta="UniversalDragDelta" DragStarted="NEResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> x:Name="NWResize"
<Thumb x:Name="SWResize" Cursor="SizeNESW" BorderThickness="2,0,0,2" Grid.Row="3" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2" DragDelta="UniversalDragDelta" DragStarted="SWResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> Grid.Row="0"
<Thumb x:Name="SEResize" Cursor="SizeNWSE" BorderThickness="0,0,2,2" Grid.Row="3" Grid.Column="3" Grid.RowSpan="2" Grid.ColumnSpan="2" DragDelta="UniversalDragDelta" DragStarted="SEResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> Grid.RowSpan="2"
Grid.Column="0"
Grid.ColumnSpan="2"
BorderThickness="2,2,0,0"
Cursor="SizeNWSE"
DragDelta="UniversalDragDelta"
DragStarted="NWResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="NEResize"
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="3"
Grid.ColumnSpan="2"
BorderThickness="0,2,2,0"
Cursor="SizeNESW"
DragDelta="UniversalDragDelta"
DragStarted="NEResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="SWResize"
Grid.Row="3"
Grid.RowSpan="2"
Grid.Column="0"
Grid.ColumnSpan="2"
BorderThickness="2,0,0,2"
Cursor="SizeNESW"
DragDelta="UniversalDragDelta"
DragStarted="SWResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="SEResize"
Grid.Row="3"
Grid.RowSpan="2"
Grid.Column="3"
Grid.ColumnSpan="2"
BorderThickness="0,0,2,2"
Cursor="SizeNWSE"
DragDelta="UniversalDragDelta"
DragStarted="SEResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Button Content="&#xE894;" <Button
BorderThickness="0" Grid.Row="2"
ToolTip="{x:Static props:Resources.Delete_Zone}" Grid.Column="2"
Background="Transparent" Padding="4"
FontSize="16" HorizontalAlignment="Right"
Padding="4" VerticalAlignment="Top"
Click="OnClose" Background="Transparent"
IsTabStop="False" BorderThickness="0"
Focusable="False" Click="OnClose"
Grid.Row="2" Content="&#xE894;"
Grid.Column="2" Focusable="False"
FontFamily="{StaticResource SymbolThemeFontFamily}" FontFamily="{StaticResource SymbolThemeFontFamily}"
HorizontalAlignment="Right" FontSize="16"
VerticalAlignment="Top" Style="{DynamicResource CloseButtonStyle}"/> IsTabStop="False"
Style="{DynamicResource CloseButtonStyle}"
ToolTip="{x:Static props:Resources.Delete_Zone}" />
<Canvas x:Name="Body" /> <Canvas x:Name="Body" />
</Grid> </Grid>

View File

@@ -1,9 +1,10 @@
<Button x:Class="FancyZonesEditor.ClickAutomationEventButton" <Button
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.ClickAutomationEventButton"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:local="clr-namespace:FancyZonesEditor"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450"
</Button> d:DesignWidth="800"
mc:Ignorable="d" />

View File

@@ -1,5 +1,5 @@
<Slider x:Class="FancyZonesEditor.Controls.CustomSlider" <Slider
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.Controls.CustomSlider"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:FancyZonesEditor.Controls"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
</Slider> xmlns:local="clr-namespace:FancyZonesEditor.Controls" />

View File

@@ -13,29 +13,32 @@
<Grid> <Grid>
<Canvas x:Name="Preview" /> <Canvas x:Name="Preview" />
<Canvas x:Name="AdornerLayer" /> <Canvas x:Name="AdornerLayer" />
<Canvas x:Name="MergePanel" <Canvas
MouseUp="MergePanelMouseUp" x:Name="MergePanel"
Visibility="Collapsed"> MouseUp="MergePanelMouseUp"
Visibility="Collapsed">
<Canvas.Effect> <Canvas.Effect>
<DropShadowEffect BlurRadius="6" Opacity="0.32" ShadowDepth="2" /> <DropShadowEffect
BlurRadius="6"
Opacity="0.32"
ShadowDepth="2" />
</Canvas.Effect> </Canvas.Effect>
<StackPanel x:Name="MergeButtons" <StackPanel x:Name="MergeButtons" Orientation="Horizontal">
Orientation="Horizontal"> <Border Background="{DynamicResource PrimaryBackgroundBrush}" CornerRadius="4">
<Border CornerRadius="4"
Background="{DynamicResource PrimaryBackgroundBrush}"> <Button
Width="134"
<Button Width="134" Height="36"
Height="36" Margin="0"
Margin="0" Click="MergeClick"
Style="{StaticResource DefaultButtonStyle}" Style="{StaticResource DefaultButtonStyle}">
Click="MergeClick">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xE746;" <TextBlock
FontFamily="{StaticResource SymbolThemeFontFamily}" Margin="0,3,8,0"
Foreground="{DynamicResource PrimaryForegroundBrush}" FontFamily="{StaticResource SymbolThemeFontFamily}"
Margin="0,3,8,0" /> Foreground="{DynamicResource PrimaryForegroundBrush}"
<TextBlock Text="{x:Static props:Resources.Merge_zones}" Text="&#xE746;" />
Foreground="{DynamicResource PrimaryForegroundBrush}"/> <TextBlock Foreground="{DynamicResource PrimaryForegroundBrush}" Text="{x:Static props:Resources.Merge_zones}" />
</StackPanel> </StackPanel>
</Button> </Button>
</Border> </Border>

View File

@@ -1,86 +1,81 @@
<local:EditorWindow x:Class="FancyZonesEditor.GridEditorWindow" <local:EditorWindow
AutomationProperties.Name="{x:Static props:Resources.Grid_Layout_Editor}" x:Class="FancyZonesEditor.GridEditorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:props="clr-namespace:FancyZonesEditor.Properties" xmlns:props="clr-namespace:FancyZonesEditor.Properties"
mc:Ignorable="d" xmlns:ui="http://schemas.modernwpf.com/2019"
Title="" Title=""
MinWidth="360" MinWidth="360"
BorderThickness="0" ui:TitleBar.IsIconVisible="False"
xmlns:ui="http://schemas.modernwpf.com/2019" ui:WindowHelper.UseModernWindowStyle="True"
ui:WindowHelper.UseModernWindowStyle="True" AutomationProperties.Name="{x:Static props:Resources.Grid_Layout_Editor}"
ui:TitleBar.IsIconVisible="False" Background="{DynamicResource PrimaryBackgroundBrush}"
SizeToContent="WidthAndHeight" BorderThickness="0"
Background="{DynamicResource PrimaryBackgroundBrush}" Closed="OnClosed"
ResizeMode="NoResize" ContentRendered="EditorWindow_ContentRendered"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize"
ContentRendered="EditorWindow_ContentRendered" SizeToContent="WidthAndHeight"
Closed="OnClosed"> WindowStartupLocation="CenterOwner"
mc:Ignorable="d">
<Grid> <Grid>
<Grid <Grid
Height="36" Height="36"
Background="{DynamicResource SecondaryBackgroundBrush}"
Margin="0,-36,0,0" Margin="0,-36,0,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top" VerticalAlignment="Top"
HorizontalAlignment="Stretch"> Background="{DynamicResource SecondaryBackgroundBrush}">
<Border <Border
Background="{DynamicResource TitleBarSecondaryForegroundBrush}"
Width="30" Width="30"
Height="3" Height="3"
CornerRadius="1.5" Margin="0,4,0,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Margin="0,4,0,0" /> Background="{DynamicResource TitleBarSecondaryForegroundBrush}"
CornerRadius="1.5" />
</Grid> </Grid>
<StackPanel Margin="16"> <StackPanel Margin="16">
<StackPanel Margin="0,8,0,0"> <StackPanel Margin="0,8,0,0">
<TextBlock <TextBlock Focusable="True" TextWrapping="Wrap">
Focusable="True" <Run FontWeight="Bold" Text="{x:Static props:Resources.SplitterName}" />
TextWrapping="Wrap">
<Run
FontWeight="Bold"
Text="{x:Static props:Resources.SplitterName}" />
<Run Text="{x:Static props:Resources.SplitterDescription}" /> <Run Text="{x:Static props:Resources.SplitterDescription}" />
</TextBlock> </TextBlock>
<TextBlock <TextBlock
Margin="0,8,0,0" Margin="0,8,0,0"
Focusable="True" Focusable="True"
TextWrapping="Wrap"> TextWrapping="Wrap">
<Run <Run FontWeight="Bold" Text="{x:Static props:Resources.MergeName}" />
FontWeight="Bold"
Text="{x:Static props:Resources.MergeName}" />
<Run Text="{x:Static props:Resources.MergeDescription}" /> <Run Text="{x:Static props:Resources.MergeDescription}" />
</TextBlock> </TextBlock>
<TextBlock <TextBlock
Margin="0,8,0,0" Margin="0,8,0,0"
Focusable="True" Focusable="True"
TextWrapping="Wrap"> TextWrapping="Wrap">
<Run <Run FontWeight="Bold" Text="{x:Static props:Resources.KeyboardControlsName}" />
FontWeight="Bold"
Text="{x:Static props:Resources.KeyboardControlsName}" />
<Run Text="{x:Static props:Resources.KeyboardControlsDescription}" /> <Run Text="{x:Static props:Resources.KeyboardControlsDescription}" />
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
<Grid Margin="0,24,0,-36"> <Grid Margin="0,24,0,-36">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*" />
<ColumnDefinition Width="8"/> <ColumnDefinition Width="8" />
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Content="{x:Static props:Resources.Cancel}" <Button
Style="{StaticResource DefaultButtonStyle}"
HorizontalAlignment="Stretch"
TabIndex="1"
Grid.Column="2" Grid.Column="2"
Click="OnCancel" />
<Button Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Click="OnSaveApplyTemplate" /> Click="OnCancel"
Content="{x:Static props:Resources.Cancel}"
Style="{StaticResource DefaultButtonStyle}"
TabIndex="1" />
<Button
HorizontalAlignment="Stretch"
Click="OnSaveApplyTemplate"
Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="0" />
</Grid> </Grid>
</StackPanel> </StackPanel>
</Grid> </Grid>

View File

@@ -1,46 +1,49 @@
<Thumb x:Class="FancyZonesEditor.GridResizer" <Thumb
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.GridResizer"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:props="clr-namespace:FancyZonesEditor.Properties" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" xmlns:props="clr-namespace:FancyZonesEditor.Properties"
Focusable="True" d:DesignHeight="300"
AutomationProperties.Name="{x:Static props:Resources.Resizer_Thumb_Announce}" d:DesignWidth="300"
d:DesignHeight="300" d:DesignWidth="300"> AutomationProperties.Name="{x:Static props:Resources.Resizer_Thumb_Announce}"
Focusable="True"
mc:Ignorable="d">
<Thumb.Template> <Thumb.Template>
<ControlTemplate> <ControlTemplate>
<Border x:Name="Body" <Border
Height="48" x:Name="Body"
Width="48" Width="48"
CornerRadius="48" Height="48"
Background="{DynamicResource SystemControlBackgroundAccentBrush}"> Background="{DynamicResource SystemControlBackgroundAccentBrush}"
CornerRadius="48">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="6" <DropShadowEffect
Opacity="0.24" BlurRadius="6"
ShadowDepth="1" /> Opacity="0.24"
ShadowDepth="1" />
</Border.Effect> </Border.Effect>
<Grid> <Grid>
<Rectangle Height="20" <Rectangle
Width="2" Width="2"
Fill="White" Height="20"
Margin="5,0,0,0" /> Margin="5,0,0,0"
<Rectangle Height="20" Fill="White" />
Width="2" <Rectangle
Fill="White" Width="2"
Margin="-5,0,0,0" /> Height="20"
Margin="-5,0,0,0"
Fill="White" />
</Grid> </Grid>
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true"> <Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" <Setter TargetName="Body" Property="Background" Value="{DynamicResource SystemAccentColorLight1Brush}" />
TargetName="Body"
Value="{DynamicResource SystemAccentColorLight1Brush}"/>
</Trigger> </Trigger>
<Trigger Property="IsKeyboardFocused" Value="True"> <Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="Background" TargetName="Body" <Setter TargetName="Body" Property="Background" Value="{DynamicResource SystemAccentColorLight3Brush}" />
Value="{DynamicResource SystemAccentColorLight3Brush}" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>

View File

@@ -4,39 +4,39 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.modernwpf.com/2019"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
ui:ControlHelper.CornerRadius="4"
Background="{DynamicResource GridZoneBackgroundBrush}" Background="{DynamicResource GridZoneBackgroundBrush}"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}" BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
BorderThickness="1" BorderThickness="1"
Opacity="1"
Focusable="True" Focusable="True"
IsTabStop="True" IsTabStop="True"
ui:ControlHelper.CornerRadius="4" Opacity="1"
mc:Ignorable="d"> mc:Ignorable="d">
<Grid x:Name="Frame"> <Grid x:Name="Frame">
<Canvas x:Name="Body" /> <Canvas x:Name="Body" />
<DockPanel HorizontalAlignment="Center" <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
VerticalAlignment="Center">
<Label <Label
Name="LabelID" Name="LabelID"
DockPanel.Dock="Top"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Content="ID" Content="ID"
DockPanel.Dock="Top"
FontSize="68" FontSize="68"
FontWeight="SemiBold" FontWeight="SemiBold"
Foreground="{DynamicResource PrimaryForegroundBrush}" /> Foreground="{DynamicResource PrimaryForegroundBrush}" />
<TextBlock FontSize="16" <TextBlock
Foreground="{DynamicResource SecondaryForegroundBrush}" HorizontalAlignment="Center"
FontWeight="SemiBold" VerticalAlignment="Center"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
HorizontalAlignment="Center" FontSize="16"
VerticalAlignment="Center"> FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryForegroundBrush}">
<Run x:Name="WidthLabel" /> <Run x:Name="WidthLabel" />
<Run Text="×" /> <Run Text="×" />
<Run x:Name="HeightLabel" /> <Run x:Name="HeightLabel" />

View File

@@ -1,16 +1,17 @@
<Window x:Class="FancyZonesEditor.LayoutOverlayWindow" <Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.LayoutOverlayWindow"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:local="clr-namespace:FancyZonesEditor"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="FancyZones Layout" Title="FancyZones Layout"
Height="450" Width="800"
Width="800" Height="450"
ShowInTaskbar="False" AllowsTransparency="True"
ResizeMode="NoResize" Background="{DynamicResource BackdropBrush}"
WindowStyle="None" Loaded="Window_Loaded"
AllowsTransparency="True" ResizeMode="NoResize"
Loaded="Window_Loaded" ShowInTaskbar="False"
Background="{DynamicResource BackdropBrush}"/> WindowStyle="None"
mc:Ignorable="d" />

View File

@@ -1,17 +1,16 @@
<UserControl x:Class="FancyZonesEditor.LayoutPreview" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.LayoutPreview"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:local="clr-namespace:FancyZonesEditor"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Loaded="OnLoaded" d:DesignHeight="450"
d:DesignHeight="450" d:DesignWidth="800"
d:DesignWidth="800"> Loaded="OnLoaded"
mc:Ignorable="d">
<Grid> <Grid>
<Border CornerRadius="4" <Border Background="{DynamicResource LayoutPreviewBackgroundBrush}" CornerRadius="4" />
Background="{DynamicResource LayoutPreviewBackgroundBrush}" /> <Grid x:Name="Body" Background="Transparent" />
<Grid x:Name="Body"
Background="Transparent" />
</Grid> </Grid>
</UserControl> </UserControl>

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:ui="http://schemas.modernwpf.com/2019"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019">
<Style x:Key="LayoutTypeRadioButtonStyle" TargetType="RadioButton"> <Style x:Key="LayoutTypeRadioButtonStyle" TargetType="RadioButton">
<Setter Property="OverridesDefaultStyle" Value="True" /> <Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" /> <Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" />
@@ -27,50 +28,50 @@
Background="Transparent" Background="Transparent"
BorderBrush="Transparent" BorderBrush="Transparent"
BorderThickness="2" BorderThickness="2"
SnapsToDevicePixels="True"> SnapsToDevicePixels="True">
<Grid>
<Border
x:Name="CheckGlyph"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
BorderThickness="2"
CornerRadius="4"
Opacity="0"
UseLayoutRounding="False" />
<ui:ContentPresenterEx
x:Name="ContentPresenter"
Grid.Column="1"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
TextElement.Foreground="{TemplateBinding Foreground}"
TextWrapping="Wrap" />
</Grid>
<VisualStateManager.VisualStateGroups> <VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CheckStates"> <VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked"> <VisualState x:Name="Checked">
<Storyboard> <Storyboard>
<DoubleAnimation Storyboard.TargetName="CheckGlyph" <DoubleAnimation
Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckGlyph"
To="1" Storyboard.TargetProperty="Opacity"
Duration="0" /> To="1"
Duration="0" />
</Storyboard> </Storyboard>
</VisualState> </VisualState>
<VisualState x:Name="Unchecked" /> <VisualState x:Name="Unchecked" />
<VisualState x:Name="Indeterminate" /> <VisualState x:Name="Indeterminate" />
</VisualStateGroup> </VisualStateGroup>
</VisualStateManager.VisualStateGroups> </VisualStateManager.VisualStateGroups>
<Grid>
<Border x:Name="CheckGlyph"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
UseLayoutRounding="False"
Opacity="0"
CornerRadius="4"
BorderThickness="2"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}" />
<ui:ContentPresenterEx x:Name="ContentPresenter"
TextElement.Foreground="{TemplateBinding Foreground}"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Grid.Column="1"
TextWrapping="Wrap"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="ContentPresenter" <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource RadioButtonForegroundPointerOver}" />
Property="Foreground"
Value="{DynamicResource RadioButtonForegroundPointerOver}" />
<Setter TargetName="CheckGlyph" Property="Opacity" Value="0.6" /> <Setter TargetName="CheckGlyph" Property="Opacity" Value="0.6" />
</Trigger> </Trigger>
@@ -90,63 +91,48 @@
</Setter> </Setter>
</Style> </Style>
<Style x:Key="IconOnlyButtonStyle" <Style
BasedOn="{StaticResource DefaultButtonStyle}" x:Key="IconOnlyButtonStyle"
TargetType="Button"> BasedOn="{StaticResource DefaultButtonStyle}"
<Setter Property="Background" TargetType="Button">
Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" <Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
Value="{DynamicResource ButtonForeground}" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="Button"> <ControlTemplate TargetType="Button">
<Border x:Name="Background" <Border
Background="Transparent" x:Name="Background"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" Background="Transparent"
SnapsToDevicePixels="True"> CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
<Border x:Name="Border" SnapsToDevicePixels="True">
BorderBrush="{TemplateBinding BorderBrush}" <Border
BorderThickness="{TemplateBinding BorderThickness}" x:Name="Border"
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"> BorderBrush="{TemplateBinding BorderBrush}"
<ContentPresenter x:Name="ContentPresenter" BorderThickness="{TemplateBinding BorderThickness}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" <ContentPresenter
Focusable="False" x:Name="ContentPresenter"
RecognizesAccessKey="True" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border> </Border>
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" <Trigger Property="IsMouseOver" Value="True">
Value="True"> <Setter TargetName="Background" Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" />
<Setter TargetName="Background" <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPointerOver}" />
Property="Background"
Value="{DynamicResource ButtonBackgroundPointerOver}" />
<Setter TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource ButtonBorderBrushPointerOver}" />
</Trigger> </Trigger>
<Trigger Property="IsPressed" <Trigger Property="IsPressed" Value="True">
Value="True"> <Setter TargetName="Background" Property="Background" Value="{DynamicResource ButtonBackgroundPressed}" />
<Setter TargetName="Background" <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPressed}" />
Property="Background"
Value="{DynamicResource ButtonBackgroundPressed}" />
<Setter TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource ButtonBorderBrushPressed}" />
</Trigger> </Trigger>
<Trigger Property="IsEnabled" <Trigger Property="IsEnabled" Value="False">
Value="False"> <Setter TargetName="Background" Property="Background" Value="{DynamicResource ButtonBackgroundDisabled}" />
<Setter TargetName="Background" <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushDisabled}" />
Property="Background" <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />
Value="{DynamicResource ButtonBackgroundDisabled}" />
<Setter TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource ButtonBorderBrushDisabled}" />
<Setter TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{DynamicResource ButtonForegroundDisabled}" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>

View File

@@ -1,135 +1,107 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:ui="http://schemas.modernwpf.com/2019"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019">
<Style x:Key="UWPFocusVisualStyle"> <Style x:Key="UWPFocusVisualStyle">
<Setter Property="Control.Template"> <Setter Property="Control.Template">
<Setter.Value> <Setter.Value>
<ControlTemplate> <ControlTemplate>
<Border Margin="-2" <Border
CornerRadius="4" Margin="-2"
BorderThickness="2" BorderBrush="{DynamicResource PrimaryForegroundBrush}"
BorderBrush="{DynamicResource PrimaryForegroundBrush}" /> BorderThickness="2"
CornerRadius="4" />
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<DropShadowEffect x:Key="CardDropShadow"
BlurRadius="6"
Opacity="0.24"
ShadowDepth="1" />
<Style x:Key="MonitorItemContainerStyle" <DropShadowEffect
TargetType="ui:GridViewItem"> x:Key="CardDropShadow"
<Setter Property="Background" BlurRadius="6"
Value="{DynamicResource LayoutItemBackgroundBrush}" /> Opacity="0.24"
<Setter Property="IsSelected" ShadowDepth="1" />
Value="{Binding Selected, Mode=OneWay}" />
<Setter Property="AutomationProperties.Name" <Style x:Key="MonitorItemContainerStyle" TargetType="ui:GridViewItem">
Value="{Binding Index}" /> <Setter Property="Background" Value="{DynamicResource LayoutItemBackgroundBrush}" />
<Setter Property="KeyboardNavigation.TabNavigation" <Setter Property="IsSelected" Value="{Binding Selected, Mode=OneWay}" />
Value="Local" /> <Setter Property="AutomationProperties.Name" Value="{Binding Index}" />
<Setter Property="MinWidth" <Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
Value="0" /> <Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" <Setter Property="MinHeight" Value="0" />
Value="0" />
<!--<Setter Property="IsHoldingEnabled" Value="True" />--> <!--<Setter Property="IsHoldingEnabled" Value="True" />-->
<Setter Property="CornerRadius" <Setter Property="CornerRadius" Value="4" />
Value="4" /> <Setter Property="Margin" Value="8" />
<Setter Property="Margin" <Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
Value="8" /> <Setter Property="FocusVisualMargin" Value="-2" />
<Setter Property="UseSystemFocusVisuals" <Setter Property="FocusVisualStyle" Value="{DynamicResource UWPFocusVisualStyle}" />
Value="{DynamicResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin"
Value="-2" />
<Setter Property="FocusVisualStyle"
Value="{DynamicResource UWPFocusVisualStyle}" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ui:GridViewItem"> <ControlTemplate TargetType="ui:GridViewItem">
<Border x:Name="ContentBorder" <Border
Height="{Binding DisplayHeight}" x:Name="ContentBorder"
Width="{Binding DisplayWidth}" Width="{Binding DisplayWidth}"
Background="{TemplateBinding Background}" Height="{Binding DisplayHeight}"
BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="{TemplateBinding CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" CornerRadius="{TemplateBinding CornerRadius}"
Effect="{StaticResource CardDropShadow}"> Effect="{StaticResource CardDropShadow}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<VisualStateManager.CustomVisualStateManager> <VisualStateManager.CustomVisualStateManager>
<ui:SimpleVisualStateManager /> <ui:SimpleVisualStateManager />
</VisualStateManager.CustomVisualStateManager> </VisualStateManager.CustomVisualStateManager>
<Grid> <Grid>
<ContentPresenter x:Name="ContentPresenter" <ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" x:Name="ContentPresenter"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}"
Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
<Border x:Name="BorderRectangle" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
IsHitTestVisible="False" <Border
BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}" x:Name="BorderRectangle"
BorderThickness="2" BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}"
CornerRadius="4" BorderThickness="2"
Opacity="0" /> CornerRadius="4"
IsHitTestVisible="False"
Opacity="0" />
</Grid> </Grid>
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<!-- Focused --> <!-- Focused -->
<Trigger Property="ui:FocusVisualHelper.ShowFocusVisual" <Trigger Property="ui:FocusVisualHelper.ShowFocusVisual" Value="True">
Value="True"> <Setter TargetName="BorderRectangle" Property="Visibility" Value="Collapsed" />
<Setter TargetName="BorderRectangle"
Property="Visibility"
Value="Collapsed" />
</Trigger> </Trigger>
<MultiDataTrigger> <MultiDataTrigger>
<MultiDataTrigger.Conditions> <MultiDataTrigger.Conditions>
<Condition Binding="{Binding Selected}" <Condition Binding="{Binding Selected}" Value="True" />
Value="True" />
</MultiDataTrigger.Conditions> </MultiDataTrigger.Conditions>
<Setter TargetName="ContentPresenter" <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource SystemControlHighlightAccentBrush}" />
Property="TextElement.Foreground" <Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
Value="{DynamicResource SystemControlHighlightAccentBrush}" /> <Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightAccentBrush}" />
<Setter TargetName="BorderRectangle"
Property="Opacity"
Value="1" />
<Setter TargetName="BorderRectangle"
Property="BorderBrush"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
</MultiDataTrigger> </MultiDataTrigger>
<!-- PointerOver --> <!-- PointerOver -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="IsMouseOver" <Condition Property="IsMouseOver" Value="True" />
Value="True" /> <Condition Property="IsSelected" Value="False" />
<Condition Property="IsSelected"
Value="False" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="BorderRectangle" <Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
Property="Opacity" <Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightListLowBrush}" />
Value="1" /> <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
<Setter TargetName="BorderRectangle" <Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush" Value="{DynamicResource SystemControlHighlightListLowBrush}" />
Property="BorderBrush" <Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness" Value="2" />
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness"
Value="2" />
</MultiTrigger> </MultiTrigger>
<!-- Selected --> <!-- Selected -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="IsMouseOver" <Condition Property="IsMouseOver" Value="False" />
Value="False" /> <Condition Property="IsSelected" Value="True" />
<Condition Property="IsSelected"
Value="True" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<!--<Setter TargetName="BorderRectangle" <!--<Setter TargetName="BorderRectangle"
@@ -147,143 +119,103 @@
Value="2" />--> Value="2" />-->
</MultiTrigger> </MultiTrigger>
<!-- PointerOverSelected --> <!-- PointerOverSelected -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="IsMouseOver" <Condition Property="IsMouseOver" Value="True" />
Value="True" /> <Condition Property="IsSelected" Value="True" />
<Condition Property="IsSelected"
Value="True" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="BorderRectangle" <Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
Property="Opacity" <Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
Value="1" /> <Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter TargetName="BorderRectangle" <Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness" Value="2" />
Property="BorderBrush"
Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush"
Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness"
Value="2" />
</MultiTrigger> </MultiTrigger>
<!-- Disabled --> <!-- Disabled -->
<Trigger Property="IsEnabled" <Trigger Property="IsEnabled" Value="False">
Value="False"> <Setter TargetName="ContentBorder" Property="Opacity" Value="{DynamicResource ListViewItemDisabledThemeOpacity}" />
<Setter TargetName="ContentBorder"
Property="Opacity"
Value="{DynamicResource ListViewItemDisabledThemeOpacity}" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style x:Key="LayoutItemContainerStyle" <Style x:Key="LayoutItemContainerStyle" TargetType="ui:GridViewItem">
TargetType="ui:GridViewItem"> <Setter Property="Background" Value="{DynamicResource LayoutItemBackgroundBrush}" />
<Setter Property="Background" <Setter Property="IsSelected" Value="{Binding IsApplied, Mode=OneWay}" />
Value="{DynamicResource LayoutItemBackgroundBrush}" /> <Setter Property="AutomationProperties.Name" Value="{Binding Name}" />
<Setter Property="IsSelected" <Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
Value="{Binding IsApplied, Mode=OneWay}" />
<Setter Property="AutomationProperties.Name"
Value="{Binding Name}" />
<Setter Property="KeyboardNavigation.TabNavigation"
Value="Local" />
<!--<Setter Property="IsHoldingEnabled" Value="True" />--> <!--<Setter Property="IsHoldingEnabled" Value="True" />-->
<Setter Property="CornerRadius" <Setter Property="CornerRadius" Value="4" />
Value="4" /> <Setter Property="Margin" Value="8" />
<Setter Property="Margin" <Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
Value="8" /> <Setter Property="FocusVisualMargin" Value="-2" />
<Setter Property="UseSystemFocusVisuals" <Setter Property="FocusVisualStyle" Value="{DynamicResource UWPFocusVisualStyle}" />
Value="{DynamicResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin"
Value="-2" />
<Setter Property="FocusVisualStyle"
Value="{DynamicResource UWPFocusVisualStyle}" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ui:GridViewItem"> <ControlTemplate TargetType="ui:GridViewItem">
<Border x:Name="ContentBorder" <Border
Background="{TemplateBinding Background}" x:Name="ContentBorder"
BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="{TemplateBinding CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" CornerRadius="{TemplateBinding CornerRadius}"
Effect="{StaticResource CardDropShadow}"> Effect="{StaticResource CardDropShadow}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<VisualStateManager.CustomVisualStateManager> <VisualStateManager.CustomVisualStateManager>
<ui:SimpleVisualStateManager /> <ui:SimpleVisualStateManager />
</VisualStateManager.CustomVisualStateManager> </VisualStateManager.CustomVisualStateManager>
<Grid> <Grid>
<ContentPresenter x:Name="ContentPresenter" <ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" x:Name="ContentPresenter"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}"
Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
<Border x:Name="BorderRectangle" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
IsHitTestVisible="False" <Border
BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}" x:Name="BorderRectangle"
BorderThickness="2" BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}"
CornerRadius="4" BorderThickness="2"
Opacity="0" /> CornerRadius="4"
IsHitTestVisible="False"
Opacity="0" />
</Grid> </Grid>
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<!-- Focused --> <!-- Focused -->
<Trigger Property="ui:FocusVisualHelper.ShowFocusVisual" <Trigger Property="ui:FocusVisualHelper.ShowFocusVisual" Value="True">
Value="True"> <Setter TargetName="BorderRectangle" Property="Visibility" Value="Collapsed" />
<Setter TargetName="BorderRectangle"
Property="Visibility"
Value="Collapsed" />
</Trigger> </Trigger>
<MultiDataTrigger> <MultiDataTrigger>
<MultiDataTrigger.Conditions> <MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsApplied}" <Condition Binding="{Binding IsApplied}" Value="True" />
Value="True" />
</MultiDataTrigger.Conditions> </MultiDataTrigger.Conditions>
<Setter TargetName="ContentPresenter" <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource SystemControlHighlightAccentBrush}" />
Property="TextElement.Foreground" <Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
Value="{DynamicResource SystemControlHighlightAccentBrush}" /> <Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightAccentBrush}" />
<Setter TargetName="BorderRectangle"
Property="Opacity"
Value="1" />
<Setter TargetName="BorderRectangle"
Property="BorderBrush"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
</MultiDataTrigger> </MultiDataTrigger>
<!-- PointerOver --> <!-- PointerOver -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="IsMouseOver" <Condition Property="IsMouseOver" Value="True" />
Value="True" /> <Condition Property="IsSelected" Value="False" />
<Condition Property="IsSelected"
Value="False" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="BorderRectangle" <Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
Property="Opacity" <Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightListLowBrush}" />
Value="1" /> <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
<Setter TargetName="BorderRectangle" <Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush" Value="{DynamicResource SystemControlHighlightListLowBrush}" />
Property="BorderBrush" <Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness" Value="2" />
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness"
Value="2" />
</MultiTrigger> </MultiTrigger>
<!-- Selected --> <!-- Selected -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="IsMouseOver" <Condition Property="IsMouseOver" Value="False" />
Value="False" /> <Condition Property="IsSelected" Value="True" />
<Condition Property="IsSelected"
Value="True" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<!--<Setter TargetName="BorderRectangle" <!--<Setter TargetName="BorderRectangle"
@@ -301,33 +233,22 @@
Value="2" />--> Value="2" />-->
</MultiTrigger> </MultiTrigger>
<!-- PointerOverSelected --> <!-- PointerOverSelected -->
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="IsMouseOver" <Condition Property="IsMouseOver" Value="True" />
Value="True" /> <Condition Property="IsSelected" Value="True" />
<Condition Property="IsSelected"
Value="True" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="BorderRectangle" <Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
Property="Opacity" <Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
Value="1" /> <Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter TargetName="BorderRectangle" <Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness" Value="2" />
Property="BorderBrush"
Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush"
Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness"
Value="2" />
</MultiTrigger> </MultiTrigger>
<!-- Disabled --> <!-- Disabled -->
<Trigger Property="IsEnabled" <Trigger Property="IsEnabled" Value="False">
Value="False"> <Setter TargetName="ContentBorder" Property="Opacity" Value="{DynamicResource ListViewItemDisabledThemeOpacity}" />
<Setter TargetName="ContentBorder"
Property="Opacity"
Value="{DynamicResource ListViewItemDisabledThemeOpacity}" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>

View File

@@ -1,9 +1,14 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FancyZonesEditor.Styles"> xmlns:local="clr-namespace:FancyZonesEditor.Styles"
xmlns:ui="http://schemas.modernwpf.com/2019">
<DropShadowEffect x:Key="ZoneDropShadow" BlurRadius="16" Opacity="0.28" ShadowDepth="1" /> <DropShadowEffect
x:Key="ZoneDropShadow"
BlurRadius="16"
Opacity="0.28"
ShadowDepth="1" />
<Style x:Key="GridLayoutSmallScalePreviewStyle" TargetType="Border"> <Style x:Key="GridLayoutSmallScalePreviewStyle" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource LayoutPreviewSmallScaleZoneBackgroundBrush}" /> <Setter Property="Background" Value="{DynamicResource LayoutPreviewSmallScaleZoneBackgroundBrush}" />

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=System.Runtime"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">Dark.Accent1</system:String> <system:String x:Key="Theme.Name">Dark.Accent1</system:String>
@@ -9,7 +10,7 @@
<system:String x:Key="Theme.BaseColorScheme">Dark</system:String> <system:String x:Key="Theme.BaseColorScheme">Dark</system:String>
<system:String x:Key="Theme.ColorScheme">Accent1</system:String> <system:String x:Key="Theme.ColorScheme">Accent1</system:String>
<Color x:Key="Theme.PrimaryAccentColor">Black</Color> <Color x:Key="Theme.PrimaryAccentColor">Black</Color>
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF242424" /> <SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF242424" />
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF1c1c1c" /> <SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF1c1c1c" />
<SolidColorBrush x:Key="TertiaryBackgroundBrush" Color="#FF202020" /> <SolidColorBrush x:Key="TertiaryBackgroundBrush" Color="#FF202020" />
@@ -17,14 +18,14 @@
<SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FF9a9a9a" /> <SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FF9a9a9a" />
<SolidColorBrush x:Key="BackdropBrush" Color="#40F0F0F0" /> <SolidColorBrush x:Key="BackdropBrush" Color="#40F0F0F0" />
<SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF9a9a9a" /> <SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF9a9a9a" />
<!-- Used for layouts and monitors --> <!-- Used for layouts and monitors -->
<SolidColorBrush x:Key="LayoutItemBackgroundBrush" Color="#FF3A3A3A" /> <SolidColorBrush x:Key="LayoutItemBackgroundBrush" Color="#FF3A3A3A" />
<SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FF333333" /> <SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FF333333" />
<!-- Used for the fullscreen preview (ActualScale) and for the thumbnail preview (SmallScale) --> <!-- Used for the fullscreen preview (ActualScale) and for the thumbnail preview (SmallScale) -->
<SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#331B1B1B" /> <SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#331B1B1B" />
<!-- Currently unused --> <!-- Currently unused -->
<SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#FF555454" /> <SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#FF555454" />
<SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#B0202020" /> <SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#B0202020" />

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=System.Runtime"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent2</system:String> <system:String x:Key="Theme.Name">HighContrast.Accent2</system:String>

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=System.Runtime"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent3</system:String> <system:String x:Key="Theme.Name">HighContrast.Accent3</system:String>

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=System.Runtime"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent4</system:String> <system:String x:Key="Theme.Name">HighContrast.Accent4</system:String>

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=System.Runtime"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent5</system:String> <system:String x:Key="Theme.Name">HighContrast.Accent5</system:String>
@@ -21,7 +22,7 @@
<SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FFf2f2f2" /> <SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FFf2f2f2" />
<SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#19949494" /> <SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#19949494" />
<SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#9c9c9c" /> <SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#9c9c9c" />
<SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#EFF3F3F3" /> <SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#EFF3F3F3" />
<SolidColorBrush x:Key="LayoutPreviewSmallScaleZoneBackgroundBrush" Color="#FFDCDCDC" /> <SolidColorBrush x:Key="LayoutPreviewSmallScaleZoneBackgroundBrush" Color="#FFDCDCDC" />
<SolidColorBrush x:Key="CanvasZoneBackgroundBrush" Color="#E5F3F3F3" /> <SolidColorBrush x:Key="CanvasZoneBackgroundBrush" Color="#E5F3F3F3" />

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=System.Runtime"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">Light.Accent1</system:String> <system:String x:Key="Theme.Name">Light.Accent1</system:String>
@@ -18,18 +19,18 @@
<SolidColorBrush x:Key="BackdropBrush" Color="#85F0F0F0" /> <SolidColorBrush x:Key="BackdropBrush" Color="#85F0F0F0" />
<SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF949494" /> <SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF949494" />
<!-- Used for layouts and monitors --> <!-- Used for layouts and monitors -->
<SolidColorBrush x:Key="LayoutItemBackgroundBrush" Color="#FFffffff"/> <SolidColorBrush x:Key="LayoutItemBackgroundBrush" Color="#FFffffff" />
<SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FFf2f2f2" /> <SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FFf2f2f2" />
<!-- Used for the fullscreen preview (ActualScale) and for the thumbnail preview (SmallScale) --> <!-- Used for the fullscreen preview (ActualScale) and for the thumbnail preview (SmallScale) -->
<SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#19949494" /> <SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#19949494" />
<!-- Currently unused --> <!-- Currently unused -->
<SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#FFC3BEBE" /> <SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#FFC3BEBE" />
<SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#C5F8F8F8" /> <SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#C5F8F8F8" />
<SolidColorBrush x:Key="LayoutPreviewSmallScaleZoneBackgroundBrush" Color="#FFDCDCDC" /> <SolidColorBrush x:Key="LayoutPreviewSmallScaleZoneBackgroundBrush" Color="#FFDCDCDC" />
<SolidColorBrush x:Key="CanvasZoneBackgroundBrush" Color="#C5F8F8F8" /> <SolidColorBrush x:Key="CanvasZoneBackgroundBrush" Color="#C5F8F8F8" />
<SolidColorBrush x:Key="CanvasZoneBorderBrush" Color="#CC000000" /> <SolidColorBrush x:Key="CanvasZoneBorderBrush" Color="#CC000000" />
<SolidColorBrush x:Key="GridZoneBackgroundBrush" Color="#C5F8F8F8" /> <SolidColorBrush x:Key="GridZoneBackgroundBrush" Color="#C5F8F8F8" />