Files
HandyControl/src/Shared/HandyControl_Shared/Themes/Styles/Screenshot.xaml
T
2020-04-21 00:32:11 +08:00

143 lines
9.1 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls">
<Style x:Key="MaskRect4ScreenshotStyle" TargetType="Rectangle">
<Setter Property="IsHitTestVisible" Value="False"/>
<Setter Property="Fill" Value="{DynamicResource DarkOpacityBrush}"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Style>
<Style x:Key="SnapRect4ScreenshotStyle" TargetType="Rectangle">
<Setter Property="Height" Value="5"/>
<Setter Property="Width" Value="5"/>
<Setter Property="Fill" Value="DodgerBlue"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<Trigger Property="controls:TipElement.Placement" Value="LeftTop">
<Setter Property="Margin" Value="-3, -3, 0, 0"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Trigger>
<Trigger Property="controls:TipElement.Placement" Value="Top">
<Setter Property="Margin" Value="0, -3, 0, 0"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Trigger>
<Trigger Property="controls:TipElement.Placement" Value="RightTop">
<Setter Property="Margin" Value="0, -3, -3, 0"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Trigger>
<Trigger Property="controls:TipElement.Placement" Value="Right">
<Setter Property="Margin" Value="0, 0, -3, 0"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Trigger>
<Trigger Property="controls:TipElement.Placement" Value="RightBottom">
<Setter Property="Margin" Value="0, 0, -3, -3"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
</Trigger>
<Trigger Property="controls:TipElement.Placement" Value="Bottom">
<Setter Property="Margin" Value="0, 0, 0, -3"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
</Trigger>
<Trigger Property="controls:TipElement.Placement" Value="LeftBottom">
<Setter Property="Margin" Value="-3, 0, 0, -3"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
</Trigger>
<Trigger Property="controls:TipElement.Placement" Value="Left">
<Setter Property="Margin" Value="-3, 0, 0, 0"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Trigger>
<DataTrigger Binding="{Binding IsSelecting}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsDrawing}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="TargetArea4ScreenshotStyle" TargetType="Border">
<Setter Property="IsHitTestVisible" Value="False"/>
<Setter Property="BorderThickness" Value="5"/>
<Setter Property="BorderBrush" Value="DodgerBlue"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsSelecting}" Value="True">
<Setter Property="BorderThickness" Value="1"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsDrawing}" Value="True">
<Setter Property="IsHitTestVisible" Value="True"/>
<Setter Property="BorderThickness" Value="1"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="Window4ScreenshotStyle" TargetType="controls:ScreenshotWindow">
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="WindowStyle" Value="None"/>
<Setter Property="WindowState" Value="Maximized"/>
<Setter Property="Topmost" Value="True"/>
<Setter Property="ResizeMode" Value="NoResize"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="controls:WindowAttach.IgnoreAltF4" Value="True"/>
<Setter Property="controls:WindowAttach.ShowInTaskManager" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:ScreenshotWindow">
<AdornerDecorator>
<controls:SimplePanel>
<InkCanvas EditingMode="None" Name="PART_Canvas" Background="Transparent"/>
<Rectangle Name="PART_MaskAreaLeft" Style="{StaticResource MaskRect4ScreenshotStyle}"/>
<Rectangle Name="PART_MaskAreaTop" Style="{StaticResource MaskRect4ScreenshotStyle}"/>
<Rectangle Name="PART_MaskAreaRight" Style="{StaticResource MaskRect4ScreenshotStyle}"/>
<Rectangle Name="PART_MaskAreaBottom" Style="{StaticResource MaskRect4ScreenshotStyle}"/>
<Border Name="PART_TargetArea" Style="{StaticResource TargetArea4ScreenshotStyle}">
<controls:SimplePanel>
<Rectangle controls:TipElement.Placement="LeftTop" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
<Rectangle controls:TipElement.Placement="Top" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
<Rectangle controls:TipElement.Placement="RightTop" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
<Rectangle controls:TipElement.Placement="Right" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
<Rectangle controls:TipElement.Placement="RightBottom" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
<Rectangle controls:TipElement.Placement="Bottom" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
<Rectangle controls:TipElement.Placement="LeftBottom" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
<Rectangle controls:TipElement.Placement="Left" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
<TextBlock Text="{TemplateBinding SizeStr}" Background="#CC212121" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="8,2"/>
</controls:SimplePanel>
</Border>
<Border x:Name="PART_Magnifier" IsHitTestVisible="False" Visibility="Collapsed" HorizontalAlignment="Left" VerticalAlignment="Top" Width="122" Height="122" BorderThickness="1" BorderBrush="#FF333333" CornerRadius="1">
<Border.Effect>
<DropShadowEffect BlurRadius="2" Opacity=".2" Direction="-45" RenderingBias="Performance" ShadowDepth="3"/>
</Border.Effect>
<controls:SimplePanel>
<Border Margin="0,0,0,32" Background="{TemplateBinding PreviewBrush}" BorderThickness="2" BorderBrush="White">
<controls:SimplePanel>
<Path Data="M56,0 L60,0 60,40 116,40 116,44 60,44 60,84 56,84 56,44 0,44 0,40 56,40 z" Fill="#CC4CC6FF"/>
</controls:SimplePanel>
</Border>
<Border Height="32" VerticalAlignment="Bottom" Background="#CC000000">
<StackPanel VerticalAlignment="Center" Margin="5,0,0,0">
<TextBlock Foreground="White" Text="{TemplateBinding SizeStr}"/>
</StackPanel>
</Border>
</controls:SimplePanel>
</Border>
</controls:SimplePanel>
</AdornerDecorator>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>