2019-09-04 18:26:26 +02:00
|
|
|
<UserControl x:Class="FancyZonesEditor.CanvasZone"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
2021-01-27 21:33:52 +03:00
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
|
2019-09-04 18:26:26 +02:00
|
|
|
xmlns:local="clr-namespace:FancyZonesEditor"
|
|
|
|
|
mc:Ignorable="d"
|
2020-04-08 14:46:05 +02:00
|
|
|
Background="Transparent"
|
2019-09-04 18:26:26 +02:00
|
|
|
d:DesignHeight="450" d:DesignWidth="800">
|
2020-04-08 14:46:05 +02:00
|
|
|
|
|
|
|
|
<UserControl.Resources>
|
|
|
|
|
<Style x:Key="CanvasZoneThumbStyle" TargetType="{x:Type Thumb}">
|
|
|
|
|
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
|
|
|
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type Thumb}">
|
2021-01-27 21:33:52 +03:00
|
|
|
<Border x:Name="ThumbBorder" Opacity="0" BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
2020-04-08 14:46:05 +02:00
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
|
|
|
<VisualStateGroup x:Name="CommonStates" >
|
|
|
|
|
<VisualStateGroup.Transitions>
|
|
|
|
|
<VisualTransition GeneratedDuration="0:0:0.15">
|
|
|
|
|
<VisualTransition.GeneratedEasingFunction>
|
|
|
|
|
<ExponentialEase EasingMode="EaseInOut"/>
|
|
|
|
|
</VisualTransition.GeneratedEasingFunction>
|
|
|
|
|
</VisualTransition>
|
|
|
|
|
</VisualStateGroup.Transitions>
|
|
|
|
|
<VisualState x:Name="Normal" />
|
|
|
|
|
<VisualState x:Name="MouseOver">
|
|
|
|
|
<Storyboard>
|
|
|
|
|
<DoubleAnimation Storyboard.TargetName="ThumbBorder" Duration="0:0:0.15" Storyboard.TargetProperty="Opacity" To="1"/>
|
|
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
</VisualStateGroup>
|
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
|
</Border>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
|
|
|
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
2021-01-27 21:33:52 +03:00
|
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryForegroundBrush}" />
|
2020-04-08 14:46:05 +02:00
|
|
|
<Setter Property="Padding" Value="1"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
2021-01-27 21:33:52 +03:00
|
|
|
<Border x:Name="border"
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
SnapsToDevicePixels="true">
|
|
|
|
|
<ContentPresenter x:Name="contentPresenter"
|
|
|
|
|
Focusable="False"
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
Margin="{TemplateBinding Padding}"
|
|
|
|
|
RecognizesAccessKey="True"
|
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
2020-04-08 14:46:05 +02:00
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsDefaulted" Value="true">
|
2021-01-27 21:33:52 +03:00
|
|
|
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource SystemControlBackgroundAccentBrush}"/>
|
2020-04-08 14:46:05 +02:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="true">
|
|
|
|
|
<Setter Property="Opacity" TargetName="contentPresenter" Value="0.6"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsPressed" Value="true">
|
|
|
|
|
<Setter Property="Opacity" TargetName="contentPresenter" Value="0.4"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</UserControl.Resources>
|
|
|
|
|
|
2021-01-27 21:33:52 +03:00
|
|
|
<Border BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
|
|
|
|
|
Background="{DynamicResource CanvasZoneBackgroundBrush}"
|
|
|
|
|
CornerRadius="4"
|
|
|
|
|
BorderThickness="1">
|
2020-04-08 14:46:05 +02:00
|
|
|
<Grid x:Name="Frame">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="8"/>
|
|
|
|
|
<RowDefinition Height="16"/>
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
<RowDefinition Height="16"/>
|
|
|
|
|
<RowDefinition Height="8"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="8"/>
|
|
|
|
|
<ColumnDefinition Width="16"/>
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
<ColumnDefinition Width="16"/>
|
|
|
|
|
<ColumnDefinition Width="8"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
<Label Name="LabelID"
|
2020-03-27 13:07:19 +01:00
|
|
|
Content="ID"
|
|
|
|
|
Canvas.Left="10"
|
|
|
|
|
Canvas.Bottom="10"
|
2020-04-08 14:46:05 +02:00
|
|
|
FontSize="64"
|
2021-01-27 21:33:52 +03:00
|
|
|
FontWeight="SemiBold"
|
|
|
|
|
Foreground="{DynamicResource PrimaryForegroundBrush}"
|
2020-03-27 13:07:19 +01:00
|
|
|
Grid.Column="2"
|
2020-04-08 14:46:05 +02:00
|
|
|
Grid.Row="2"
|
2020-03-27 13:07:19 +01:00
|
|
|
VerticalContentAlignment="Center"
|
|
|
|
|
HorizontalContentAlignment="Center" />
|
2020-04-08 14:46:05 +02:00
|
|
|
|
|
|
|
|
<Thumb x:Name="Caption" Cursor="SizeAll" Background="Transparent" BorderThickness="3" Padding="4" Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="0" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="Caption_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
|
|
|
|
|
|
|
|
|
|
<Thumb x:Name="NResize" Cursor="SizeNS" BorderThickness="0,3,0,0" Grid.ColumnSpan="5" DragDelta="UniversalDragDelta" DragStarted="NResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
|
|
|
|
|
<Thumb x:Name="SResize" Cursor="SizeNS" BorderThickness="0,0,0,3" Grid.Row="4" Grid.ColumnSpan="5" DragDelta="UniversalDragDelta" DragStarted="SResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
|
|
|
|
|
<Thumb x:Name="WResize" Cursor="SizeWE" BorderThickness="3,0,0,0" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="WResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
|
|
|
|
|
<Thumb x:Name="EResize" Cursor="SizeWE" BorderThickness="0,0,3,0" Grid.Column="4" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="EResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
|
|
|
|
|
|
|
|
|
|
<Thumb x:Name="NWResize" Cursor="SizeNWSE" BorderThickness="3,3,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,3,3,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="3,0,0,3" 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,3,3" Grid.Row="3" Grid.Column="3" Grid.RowSpan="2" Grid.ColumnSpan="2" DragDelta="UniversalDragDelta" DragStarted="SEResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
|
|
|
|
|
|
2021-01-27 21:33:52 +03:00
|
|
|
<Button Content=""
|
|
|
|
|
BorderThickness="0"
|
|
|
|
|
ToolTip="{x:Static props:Resources.Delete_Zone}"
|
|
|
|
|
Background="Transparent"
|
|
|
|
|
FontSize="16"
|
|
|
|
|
Padding="4"
|
|
|
|
|
Click="OnClose"
|
|
|
|
|
Grid.Row="2"
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
FontFamily="Segoe MDL2 Assets"
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
VerticalAlignment="Top" Style="{DynamicResource CloseButtonStyle}"/>
|
2020-04-08 14:46:05 +02:00
|
|
|
|
|
|
|
|
<Canvas x:Name="Body" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
2019-09-04 18:26:26 +02:00
|
|
|
</UserControl>
|