Merge remote-tracking branch 'origin/main' into dev/snickler/net8-upgrade

This commit is contained in:
Jeremy Sinclair 2023-10-11 09:30:07 -04:00
commit f058e81ed0
30 changed files with 1487 additions and 1298 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
x:Class="FancyZonesEditor.App"
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:local="clr-namespace:FancyZonesEditor" xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.modernwpf.com/2019"
Startup="OnStartup" Exit="OnExit"
Exit="OnExit"> Startup="OnStartup">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>

View File

@ -1,10 +1,12 @@
<UserControl x:Class="FancyZonesEditor.CanvasEditor" <UserControl
x:Class="FancyZonesEditor.CanvasEditor"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
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" />

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"
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
ui:TitleBar.IsIconVisible="False" ui:TitleBar.IsIconVisible="False"
SizeToContent="Width" ui:WindowHelper.UseModernWindowStyle="True"
AutomationProperties.Name="{x:Static props:Resources.Canvas_Layout_Editor}"
Background="{DynamicResource PrimaryBackgroundBrush}" Background="{DynamicResource PrimaryBackgroundBrush}"
ResizeMode="NoResize" BorderThickness="0"
WindowStartupLocation="CenterOwner" Closed="OnClosed"
ContentRendered="EditorWindow_ContentRendered" ContentRendered="EditorWindow_ContentRendered"
Closed="OnClosed"> ResizeMode="NoResize"
SizeToContent="Width"
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"
HorizontalAlignment="Stretch"
VerticalAlignment="Top" VerticalAlignment="Top"
HorizontalAlignment="Stretch"> Background="{DynamicResource SecondaryBackgroundBrush}">
<Border Background="{DynamicResource TitleBarSecondaryForegroundBrush}" <Border
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" VerticalAlignment="Bottom" <StackPanel
Margin="16"
VerticalAlignment="Bottom"
FocusManager.FocusedElement="{Binding ElementName=newZoneButton}"> FocusManager.FocusedElement="{Binding ElementName=newZoneButton}">
<local:ClickAutomationEventButton x:Name="newZoneButton" <local:ClickAutomationEventButton
HorizontalAlignment="Stretch" x:Name="newZoneButton"
Height="64"
Width="64" Width="64"
ui:ControlHelper.CornerRadius="64" Height="64"
Margin="0,8,0,0" Margin="0,8,0,0"
Style="{StaticResource AccentButtonStyle}" HorizontalAlignment="Stretch"
FontFamily="{StaticResource SymbolThemeFontFamily}" ui:ControlHelper.CornerRadius="64"
Content="&#xE710;"
FontSize="24"
TabIndex="0"
ToolTip="{x:Static props:Resources.Add_zone}"
DataContext="{Binding Path=Model, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
IsEnabled="{Binding IsZoneAddingAllowed}"
Click="OnAddZone" Click="OnAddZone"
OnClickAutomationValue="{x:Static props:Resources.New_zone_added}" /> Content="&#xE710;"
DataContext="{Binding Path=Model, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="24"
IsEnabled="{Binding IsZoneAddingAllowed}"
OnClickAutomationValue="{x:Static props:Resources.New_zone_added}"
Style="{StaticResource AccentButtonStyle}"
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}"
HorizontalAlignment="Stretch"
Grid.Column="2" Grid.Column="2"
TabIndex="2"
Click="OnCancel" />
<Button Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Click="OnSaveApplyTemplate" /> Click="OnCancel"
Content="{x:Static props:Resources.Cancel}"
Style="{StaticResource DefaultButtonStyle}"
TabIndex="2" />
<Button
HorizontalAlignment="Stretch"
Click="OnSaveApplyTemplate"
Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="1" />
</Grid> </Grid>
</StackPanel> </StackPanel>
</Grid> </Grid>

View File

@ -1,14 +1,16 @@
<UserControl x:Class="FancyZonesEditor.CanvasZone" <UserControl
x:Class="FancyZonesEditor.CanvasZone"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
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"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
KeyDown="Border_KeyDown" xmlns:props="clr-namespace:FancyZonesEditor.Properties"
d:DesignHeight="450"
d:DesignWidth="800"
Background="Transparent" Background="Transparent"
d:DesignHeight="450" d:DesignWidth="800"> 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" />
@ -16,12 +18,13 @@
<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>
@ -34,7 +37,11 @@
<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
x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="true"> SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" <ContentPresenter
Focusable="False" x:Name="contentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}" Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True" RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</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,25 +93,20 @@
</Style> </Style>
</UserControl.Resources> </UserControl.Resources>
<Border CornerRadius="0" <Border
Focusable="True"
x:Name="RootBorder" x:Name="RootBorder"
CornerRadius="0"
Focusable="True"
PreviewMouseDown="Border_PreviewMouseDown"> 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>
@ -138,60 +127,148 @@
<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"
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}" />
<TextBlock FontSize="16"
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}"
Opacity="0.6"
DockPanel.Dock="Bottom"
FontWeight="SemiBold" FontWeight="SemiBold"
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}" />
<TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center"> VerticalAlignment="Center"
DockPanel.Dock="Bottom"
FontSize="16"
FontWeight="SemiBold"
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}"
Opacity="0.6">
<Run x:Name="WidthLabel" /> <Run x:Name="WidthLabel" />
<Run Text="&#xE947;" <Run
FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="10" FontSize="10"
FontFamily="{StaticResource SymbolThemeFontFamily}" /> 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"
<Thumb x:Name="NResize" Cursor="SizeNS" BorderThickness="0,2,0,0" Grid.ColumnSpan="5" DragDelta="UniversalDragDelta" DragStarted="NResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> Grid.Row="0"
<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}"/> Grid.RowSpan="5"
<Thumb x:Name="WResize" Cursor="SizeWE" BorderThickness="2,0,0,0" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="WResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/> Grid.Column="0"
<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}"/> Grid.ColumnSpan="5"
Margin="-1"
<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 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}"/>
<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}"/>
<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}"/>
<Button Content="&#xE894;"
BorderThickness="0"
ToolTip="{x:Static props:Resources.Delete_Zone}"
Background="Transparent"
FontSize="16"
Padding="4" Padding="4"
Click="OnClose" Background="Transparent"
IsTabStop="False" BorderThickness="3"
Focusable="False" Cursor="SizeAll"
DragDelta="UniversalDragDelta"
DragStarted="Caption_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="NResize"
Grid.ColumnSpan="5"
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"
Grid.Row="0"
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
Grid.Row="2" Grid.Row="2"
Grid.Column="2" Grid.Column="2"
FontFamily="{StaticResource SymbolThemeFontFamily}" Padding="4"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Top" Style="{DynamicResource CloseButtonStyle}"/> VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
Click="OnClose"
Content="&#xE894;"
Focusable="False"
FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="16"
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
x:Class="FancyZonesEditor.ClickAutomationEventButton"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
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
x:Class="FancyZonesEditor.Controls.CustomSlider"
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:local="clr-namespace:FancyZonesEditor.Controls"> xmlns:local="clr-namespace:FancyZonesEditor.Controls" />
</Slider>

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
x:Name="MergePanel"
MouseUp="MergePanelMouseUp" MouseUp="MergePanelMouseUp"
Visibility="Collapsed"> 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"
Style="{StaticResource DefaultButtonStyle}" Click="MergeClick"
Click="MergeClick"> Style="{StaticResource DefaultButtonStyle}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xE746;" <TextBlock
Margin="0,3,8,0"
FontFamily="{StaticResource SymbolThemeFontFamily}" FontFamily="{StaticResource SymbolThemeFontFamily}"
Foreground="{DynamicResource PrimaryForegroundBrush}" Foreground="{DynamicResource PrimaryForegroundBrush}"
Margin="0,3,8,0" /> Text="&#xE746;" />
<TextBlock Text="{x:Static props:Resources.Merge_zones}" <TextBlock Foreground="{DynamicResource PrimaryForegroundBrush}" Text="{x:Static props:Resources.Merge_zones}" />
Foreground="{DynamicResource PrimaryForegroundBrush}"/>
</StackPanel> </StackPanel>
</Button> </Button>
</Border> </Border>

View File

@ -1,66 +1,59 @@
<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"
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
ui:TitleBar.IsIconVisible="False" ui:TitleBar.IsIconVisible="False"
SizeToContent="WidthAndHeight" ui:WindowHelper.UseModernWindowStyle="True"
AutomationProperties.Name="{x:Static props:Resources.Grid_Layout_Editor}"
Background="{DynamicResource PrimaryBackgroundBrush}" Background="{DynamicResource PrimaryBackgroundBrush}"
ResizeMode="NoResize" BorderThickness="0"
WindowStartupLocation="CenterOwner" Closed="OnClosed"
ContentRendered="EditorWindow_ContentRendered" ContentRendered="EditorWindow_ContentRendered"
Closed="OnClosed"> ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
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>
@ -70,17 +63,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}"
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
x:Class="FancyZonesEditor.GridResizer"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:props="clr-namespace:FancyZonesEditor.Properties" xmlns:props="clr-namespace:FancyZonesEditor.Properties"
mc:Ignorable="d" d:DesignHeight="300"
Focusable="True" d:DesignWidth="300"
AutomationProperties.Name="{x:Static props:Resources.Resizer_Thumb_Announce}" AutomationProperties.Name="{x:Static props:Resources.Resizer_Thumb_Announce}"
d:DesignHeight="300" d:DesignWidth="300"> 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
BlurRadius="6"
Opacity="0.24" Opacity="0.24"
ShadowDepth="1" /> 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" />
<Rectangle
Width="2" Width="2"
Fill="White" Height="20"
Margin="-5,0,0,0" /> 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}"
FontWeight="SemiBold"
DockPanel.Dock="Bottom"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center"> VerticalAlignment="Center"
DockPanel.Dock="Bottom"
FontSize="16"
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
x:Class="FancyZonesEditor.LayoutOverlayWindow"
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"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="FancyZones Layout" Title="FancyZones Layout"
Height="450"
Width="800" Width="800"
ShowInTaskbar="False" Height="450"
ResizeMode="NoResize"
WindowStyle="None"
AllowsTransparency="True" AllowsTransparency="True"
Background="{DynamicResource BackdropBrush}"
Loaded="Window_Loaded" Loaded="Window_Loaded"
Background="{DynamicResource BackdropBrush}"/> ResizeMode="NoResize"
ShowInTaskbar="False"
WindowStyle="None"
mc:Ignorable="d" />

View File

@ -1,17 +1,16 @@
<UserControl x:Class="FancyZonesEditor.LayoutPreview" <UserControl
x:Class="FancyZonesEditor.LayoutPreview"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
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>

View File

@ -1,4 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
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:ui="http://schemas.modernwpf.com/2019"> xmlns:ui="http://schemas.modernwpf.com/2019">
@ -27,13 +28,37 @@
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.TargetName="CheckGlyph"
Storyboard.TargetProperty="Opacity" Storyboard.TargetProperty="Opacity"
To="1" To="1"
Duration="0" /> Duration="0" />
@ -43,34 +68,10 @@
<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,26 +91,28 @@
</Setter> </Setter>
</Style> </Style>
<Style x:Key="IconOnlyButtonStyle" <Style
x:Key="IconOnlyButtonStyle"
BasedOn="{StaticResource DefaultButtonStyle}" BasedOn="{StaticResource DefaultButtonStyle}"
TargetType="Button"> TargetType="Button">
<Setter Property="Background" <Setter Property="Background" Value="Transparent" />
Value="Transparent" /> <Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
<Setter Property="Foreground"
Value="{DynamicResource ButtonForeground}" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="Button"> <ControlTemplate TargetType="Button">
<Border x:Name="Background" <Border
x:Name="Background"
Background="Transparent" Background="Transparent"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
SnapsToDevicePixels="True"> SnapsToDevicePixels="True">
<Border x:Name="Border" <Border
x:Name="Border"
Padding="{TemplateBinding Padding}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"> CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
<ContentPresenter x:Name="ContentPresenter" <ContentPresenter
x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False" Focusable="False"
@ -118,35 +121,18 @@
</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,4 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
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:ui="http://schemas.modernwpf.com/2019"> xmlns:ui="http://schemas.modernwpf.com/2019">
@ -6,130 +7,101 @@
<Setter Property="Control.Template"> <Setter Property="Control.Template">
<Setter.Value> <Setter.Value>
<ControlTemplate> <ControlTemplate>
<Border Margin="-2" <Border
CornerRadius="4" Margin="-2"
BorderBrush="{DynamicResource PrimaryForegroundBrush}"
BorderThickness="2" BorderThickness="2"
BorderBrush="{DynamicResource PrimaryForegroundBrush}" /> CornerRadius="4" />
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<DropShadowEffect x:Key="CardDropShadow" <DropShadowEffect
x:Key="CardDropShadow"
BlurRadius="6" BlurRadius="6"
Opacity="0.24" Opacity="0.24"
ShadowDepth="1" /> ShadowDepth="1" />
<Style x:Key="MonitorItemContainerStyle" <Style x:Key="MonitorItemContainerStyle" TargetType="ui:GridViewItem">
TargetType="ui:GridViewItem"> <Setter Property="Background" Value="{DynamicResource LayoutItemBackgroundBrush}" />
<Setter Property="Background" <Setter Property="IsSelected" Value="{Binding Selected, Mode=OneWay}" />
Value="{DynamicResource LayoutItemBackgroundBrush}" /> <Setter Property="AutomationProperties.Name" Value="{Binding Index}" />
<Setter Property="IsSelected" <Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
Value="{Binding Selected, Mode=OneWay}" /> <Setter Property="MinWidth" Value="0" />
<Setter Property="AutomationProperties.Name" <Setter Property="MinHeight" Value="0" />
Value="{Binding Index}" />
<Setter Property="KeyboardNavigation.TabNavigation"
Value="Local" />
<Setter Property="MinWidth"
Value="0" />
<Setter Property="MinHeight"
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}"
Height="{Binding DisplayHeight}"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 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
x:Name="ContentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Border x:Name="BorderRectangle" <Border
IsHitTestVisible="False" x:Name="BorderRectangle"
BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}" BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}"
BorderThickness="2" BorderThickness="2"
CornerRadius="4" CornerRadius="4"
IsHitTestVisible="False"
Opacity="0" /> 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"
@ -150,140 +122,100 @@
<!-- 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
x:Name="ContentBorder"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 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
x:Name="ContentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Border x:Name="BorderRectangle" <Border
IsHitTestVisible="False" x:Name="BorderRectangle"
BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}" BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}"
BorderThickness="2" BorderThickness="2"
CornerRadius="4" CornerRadius="4"
IsHitTestVisible="False"
Opacity="0" /> 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"
@ -304,30 +236,19 @@
<!-- 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="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:ui="http://schemas.modernwpf.com/2019" 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,4 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
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:system="clr-namespace:System;assembly=System.Runtime"> xmlns:system="clr-namespace:System;assembly=System.Runtime">

View File

@ -1,4 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
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:system="clr-namespace:System;assembly=System.Runtime"> xmlns:system="clr-namespace:System;assembly=System.Runtime">

View File

@ -1,4 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
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:system="clr-namespace:System;assembly=System.Runtime"> xmlns:system="clr-namespace:System;assembly=System.Runtime">

View File

@ -1,4 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
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:system="clr-namespace:System;assembly=System.Runtime"> xmlns:system="clr-namespace:System;assembly=System.Runtime">

View File

@ -1,4 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
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:system="clr-namespace:System;assembly=System.Runtime"> xmlns:system="clr-namespace:System;assembly=System.Runtime">

View File

@ -1,4 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
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:system="clr-namespace:System;assembly=System.Runtime"> xmlns:system="clr-namespace:System;assembly=System.Runtime">

View File

@ -43,24 +43,28 @@ namespace Microsoft.Plugin.Shell
{ {
new PluginAdditionalOption() new PluginAdditionalOption()
{ {
Key = "LeaveShellOpen", Key = "ShellCommandExecution",
DisplayLabel = Resources.wox_leave_shell_open, DisplayLabel = Resources.wox_shell_command_execution,
Value = _settings.LeaveShellOpen, DisplayDescription = Resources.wox_shell_command_execution_description,
PluginOptionType = PluginAdditionalOption.AdditionalOptionType.Combobox,
ComboBoxItems = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>(Resources.find_executable_file_and_run_it, "2"),
new KeyValuePair<string, string>(Resources.run_command_in_command_prompt, "0"),
new KeyValuePair<string, string>(Resources.run_command_in_powershell, "1"),
new KeyValuePair<string, string>(Resources.run_command_in_powershell_seven, "6"),
new KeyValuePair<string, string>(Resources.run_command_in_windows_terminal_cmd, "5"),
new KeyValuePair<string, string>(Resources.run_command_in_windows_terminal_powershell, "3"),
new KeyValuePair<string, string>(Resources.run_command_in_windows_terminal_powershell_seven, "4"),
},
ComboBoxValue = (int)_settings.Shell,
}, },
new PluginAdditionalOption() new PluginAdditionalOption()
{ {
Key = "ShellCommandExecution", Key = "LeaveShellOpen",
DisplayLabel = Resources.wox_shell_command_execution, DisplayLabel = Resources.wox_leave_shell_open,
PluginOptionType = PluginAdditionalOption.AdditionalOptionType.Combobox, Value = _settings.LeaveShellOpen,
ComboBoxOptions = new List<string>
{
Resources.run_command_in_command_prompt,
Resources.run_command_in_powershell,
Resources.find_executable_file_and_run_it,
Resources.run_command_in_windows_terminal,
},
ComboBoxValue = (int)_settings.Shell,
}, },
}; };
@ -209,21 +213,63 @@ namespace Microsoft.Plugin.Shell
} }
else else
{ {
arguments = $"\"{command} ; Read-Host -Prompt \\\"Press Enter to continue\\\"\""; arguments = $"\"{command} ; Read-Host -Prompt \\\"{Resources.run_plugin_cmd_wait_message}\\\"\"";
} }
info = ShellCommand.SetProcessStartInfo("powershell.exe", workingDirectory, arguments, runAsVerbArg); info = ShellCommand.SetProcessStartInfo("powershell.exe", workingDirectory, arguments, runAsVerbArg);
} }
else if (_settings.Shell == ExecutionShell.WindowsTerminal) else if (_settings.Shell == ExecutionShell.PowerShellSeven)
{ {
string arguments; string arguments;
if (_settings.LeaveShellOpen) if (_settings.LeaveShellOpen)
{ {
arguments = $"powershell -NoExit \"{command}\""; arguments = $"-NoExit -C \"{command}\"";
} }
else else
{ {
arguments = $"powershell \"{command}\""; arguments = $"-C \"{command} ; Read-Host -Prompt \\\"{Resources.run_plugin_cmd_wait_message}\\\"\"";
}
info = ShellCommand.SetProcessStartInfo("pwsh.exe", workingDirectory, arguments, runAsVerbArg);
}
else if (_settings.Shell == ExecutionShell.WindowsTerminalCmd)
{
string arguments;
if (_settings.LeaveShellOpen)
{
arguments = $"cmd.exe /k \"{command}\"";
}
else
{
arguments = $"cmd.exe /c \"{command}\" & pause";
}
info = ShellCommand.SetProcessStartInfo("wt.exe", workingDirectory, arguments, runAsVerbArg);
}
else if (_settings.Shell == ExecutionShell.WindowsTerminalPowerShell)
{
string arguments;
if (_settings.LeaveShellOpen)
{
arguments = $"powershell -NoExit -C \"{command}\"";
}
else
{
arguments = $"powershell -C \"{command}\"";
}
info = ShellCommand.SetProcessStartInfo("wt.exe", workingDirectory, arguments, runAsVerbArg);
}
else if (_settings.Shell == ExecutionShell.WindowsTerminalPowerShellSeven)
{
string arguments;
if (_settings.LeaveShellOpen)
{
arguments = $"pwsh.exe -NoExit -C \"{command}\"";
}
else
{
arguments = $"pwsh.exe -C \"{command}\"";
} }
info = ShellCommand.SetProcessStartInfo("wt.exe", workingDirectory, arguments, runAsVerbArg); info = ShellCommand.SetProcessStartInfo("wt.exe", workingDirectory, arguments, runAsVerbArg);

View File

@ -61,7 +61,7 @@ namespace Microsoft.Plugin.Shell.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Find executable file and run it. /// Looks up a localized string similar to Find and run executable file.
/// </summary> /// </summary>
public static string find_executable_file_and_run_it { public static string find_executable_file_and_run_it {
get { get {
@ -70,7 +70,7 @@ namespace Microsoft.Plugin.Shell.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Run command in Command Prompt (cmd.exe). /// Looks up a localized string similar to Run in Command Prompt (cmd.exe).
/// </summary> /// </summary>
public static string run_command_in_command_prompt { public static string run_command_in_command_prompt {
get { get {
@ -79,7 +79,7 @@ namespace Microsoft.Plugin.Shell.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Run command in PowerShell (PowerShell.exe). /// Looks up a localized string similar to Run in PowerShell (PowerShell.exe).
/// </summary> /// </summary>
public static string run_command_in_powershell { public static string run_command_in_powershell {
get { get {
@ -88,11 +88,47 @@ namespace Microsoft.Plugin.Shell.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Run command in Windows Terminal (wt.exe). /// Looks up a localized string similar to Run in PowerShell 7 (pwsh.exe).
/// </summary> /// </summary>
public static string run_command_in_windows_terminal { public static string run_command_in_powershell_seven {
get { get {
return ResourceManager.GetString("run_command_in_windows_terminal", resourceCulture); return ResourceManager.GetString("run_command_in_powershell_seven", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Run in Command Prompt (cmd.exe) using Windows Terminal.
/// </summary>
public static string run_command_in_windows_terminal_cmd {
get {
return ResourceManager.GetString("run_command_in_windows_terminal_cmd", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Run in PowerShell (PowerShell.exe) using Windows Terminal.
/// </summary>
public static string run_command_in_windows_terminal_powershell {
get {
return ResourceManager.GetString("run_command_in_windows_terminal_powershell", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Run in PowerShell 7 (pwsh.exe) using Windows Terminal.
/// </summary>
public static string run_command_in_windows_terminal_powershell_seven {
get {
return ResourceManager.GetString("run_command_in_windows_terminal_powershell_seven", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Press Enter to continue.
/// </summary>
public static string run_plugin_cmd_wait_message {
get {
return ResourceManager.GetString("run_plugin_cmd_wait_message", resourceCulture);
} }
} }
@ -178,12 +214,21 @@ namespace Microsoft.Plugin.Shell.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Shell command execution. /// Looks up a localized string similar to Command execution.
/// </summary> /// </summary>
public static string wox_shell_command_execution { public static string wox_shell_command_execution {
get { get {
return ResourceManager.GetString("wox_shell_command_execution", resourceCulture); return ResourceManager.GetString("wox_shell_command_execution", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to All entries that using the Windows Terminal forcing the Windows Terminal as console host regardless of the system setting.
/// </summary>
public static string wox_shell_command_execution_description {
get {
return ResourceManager.GetString("wox_shell_command_execution_description", resourceCulture);
}
}
} }
} }

View File

@ -145,18 +145,34 @@
<value>Keep shell open</value> <value>Keep shell open</value>
</data> </data>
<data name="wox_shell_command_execution" xml:space="preserve"> <data name="wox_shell_command_execution" xml:space="preserve">
<value>Shell command execution</value> <value>Command execution</value>
</data> </data>
<data name="run_command_in_command_prompt" xml:space="preserve"> <data name="run_command_in_command_prompt" xml:space="preserve">
<value>Run command in Command Prompt (cmd.exe)</value> <value>Run in Command Prompt (cmd.exe)</value>
</data> </data>
<data name="run_command_in_powershell" xml:space="preserve"> <data name="run_command_in_powershell" xml:space="preserve">
<value>Run command in PowerShell (PowerShell.exe)</value> <value>Run in PowerShell (PowerShell.exe)</value>
</data> </data>
<data name="find_executable_file_and_run_it" xml:space="preserve"> <data name="find_executable_file_and_run_it" xml:space="preserve">
<value>Find executable file and run it</value> <value>Find and run the executable file</value>
</data> </data>
<data name="run_command_in_windows_terminal" xml:space="preserve"> <data name="run_command_in_powershell_seven" xml:space="preserve">
<value>Run command in Windows Terminal (wt.exe)</value> <value>Run in PowerShell 7 (pwsh.exe)</value>
</data>
<data name="run_command_in_windows_terminal_cmd" xml:space="preserve">
<value>Run in Command Prompt (cmd.exe) using Windows Terminal</value>
</data>
<data name="run_command_in_windows_terminal_powershell" xml:space="preserve">
<value>Run in PowerShell (PowerShell.exe) using Windows Terminal</value>
</data>
<data name="run_command_in_windows_terminal_powershell_seven" xml:space="preserve">
<value>Run in PowerShell 7 (pwsh.exe) using Windows Terminal</value>
</data>
<data name="run_plugin_cmd_wait_message" xml:space="preserve">
<value>Press Enter to continue</value>
<comment>"Enter" means the Enter key on the keyboard.</comment>
</data>
<data name="wox_shell_command_execution_description" xml:space="preserve">
<value>All entries using the Windows Terminal force the Windows Terminal as the console host regardless of the system settings</value>
</data> </data>
</root> </root>

View File

@ -41,6 +41,9 @@ namespace Microsoft.Plugin.Shell
Cmd = 0, Cmd = 0,
Powershell = 1, Powershell = 1,
RunCommand = 2, RunCommand = 2,
WindowsTerminal = 3, WindowsTerminalPowerShell = 3,
WindowsTerminalPowerShellSeven = 4,
WindowsTerminalCmd = 5,
PowerShellSeven = 6,
} }
} }

View File

@ -54,8 +54,13 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public int ComboBoxValue { get; set; } public int ComboBoxValue { get; set; }
/// <summary>
/// Gets or sets the list of dropdown items for the ComboBox. Please use the item name as Key and an integer as Value.
/// The value gets converted in settings UI to an integer and will be saved in <see cref="ComboBoxValue"/>.
/// You can define the visibility order in settings ui by arranging the list items.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string> ComboBoxOptions { get; set; } public List<KeyValuePair<string, string>> ComboBoxItems { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string TextValue { get; set; } public string TextValue { get; set; }
@ -91,5 +96,15 @@ namespace Microsoft.PowerToys.Settings.UI.Library
/// </summary> /// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? NumberBoxLargeChange { get; set; } public double? NumberBoxLargeChange { get; set; }
// Outdated properties kept for backward compatibility with third-party plugins. (They are only required to not have old third-party plugins crashing when propagating their plugin options.)
#pragma warning disable SA1623 // Property summary documentation should match accessors
/// <summary>
/// PLEASE DON'T USE ANYMORE!! (The property was used for the list of combobox items in the past and is not functional anymore.)
/// </summary>
[JsonIgnore]
public List<string> ComboBoxOptions { get; set; }
#pragma warning restore SA1623 // Property summary documentation should match accessors
} }
} }

View File

@ -153,12 +153,8 @@
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.TabSelectsContextButtons, Mode=TwoWay}" /> <ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.TabSelectsContextButtons, Mode=TwoWay}" />
</controls:SettingsCard> </controls:SettingsCard>
<controls:SettingsCard <controls:SettingsCard x:Uid="PowerLauncher_UsePinyin" HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE98A;}">
x:Uid="PowerLauncher_UsePinyin" <ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.UsePinyin, Mode=TwoWay}" />
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE98A;}">
<ToggleSwitch
x:Uid="ToggleSwitch"
IsOn="{x:Bind ViewModel.UsePinyin, Mode=TwoWay}" />
</controls:SettingsCard> </controls:SettingsCard>
<controls:SettingsCard x:Uid="PowerLauncher_GenerateThumbnailsFromFiles"> <controls:SettingsCard x:Uid="PowerLauncher_GenerateThumbnailsFromFiles">
@ -388,8 +384,10 @@
Visibility="{x:Bind Path=ShowComboBox, Converter={StaticResource BoolToVisibilityConverter}}"> Visibility="{x:Bind Path=ShowComboBox, Converter={StaticResource BoolToVisibilityConverter}}">
<ComboBox <ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}" MinWidth="{StaticResource SettingActionControlMinWidth}"
ItemsSource="{x:Bind Path=ComboBoxOptions}" DisplayMemberPath="Key"
SelectedIndex="{x:Bind Path=ComboBoxValue, Mode=TwoWay}" /> ItemsSource="{x:Bind Path=ComboBoxItems}"
SelectedValue="{x:Bind Path=ComboBoxValue, Mode=TwoWay}"
SelectedValuePath="Value" />
</controls:SettingsCard> </controls:SettingsCard>
<!-- TextBox setting --> <!-- TextBox setting -->
<controls:SettingsCard <controls:SettingsCard
@ -456,8 +454,10 @@
IsEnabled="{x:Bind Path=SecondSettingIsEnabled, Mode=OneWay}"> IsEnabled="{x:Bind Path=SecondSettingIsEnabled, Mode=OneWay}">
<ComboBox <ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}" MinWidth="{StaticResource SettingActionControlMinWidth}"
ItemsSource="{x:Bind Path=ComboBoxOptions}" DisplayMemberPath="Key"
SelectedIndex="{x:Bind Path=ComboBoxValue, Mode=TwoWay}" /> ItemsSource="{x:Bind Path=ComboBoxItems}"
SelectedValue="{x:Bind Path=ComboBoxValue, Mode=TwoWay}"
SelectedValuePath="Value" />
</controls:SettingsCard> </controls:SettingsCard>
</StackPanel> </StackPanel>
<!-- Checkbox And TextBox setting --> <!-- Checkbox And TextBox setting -->

View File

@ -4,6 +4,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Globalization;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Microsoft.PowerToys.Settings.UI.Library; using Microsoft.PowerToys.Settings.UI.Library;
@ -47,18 +48,18 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
// ComboBox setting // ComboBox setting
public bool ShowComboBox => _additionalOption.PluginOptionType == PluginAdditionalOption.AdditionalOptionType.Combobox && public bool ShowComboBox => _additionalOption.PluginOptionType == PluginAdditionalOption.AdditionalOptionType.Combobox &&
_additionalOption.ComboBoxOptions != null && _additionalOption.ComboBoxOptions.Count > 0; _additionalOption.ComboBoxItems != null && _additionalOption.ComboBoxItems.Count > 0;
public List<string> ComboBoxOptions => _additionalOption.ComboBoxOptions; public List<KeyValuePair<string, string>> ComboBoxItems => _additionalOption.ComboBoxItems;
public int ComboBoxValue public string ComboBoxValue
{ {
get => _additionalOption.ComboBoxValue; get => _additionalOption.ComboBoxValue.ToString(CultureInfo.InvariantCulture);
set set
{ {
if (value != _additionalOption.ComboBoxValue) if (int.Parse(value, CultureInfo.InvariantCulture) != _additionalOption.ComboBoxValue)
{ {
_additionalOption.ComboBoxValue = value; _additionalOption.ComboBoxValue = int.Parse(value, CultureInfo.InvariantCulture);
NotifyPropertyChanged(); NotifyPropertyChanged();
} }
} }