<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:hc="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="hc: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="hc: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="hc: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="hc: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="hc: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="hc: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="hc: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="hc: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="hc: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="hc:WindowAttach.IgnoreAltF4" Value="True"/>
        <Setter Property="hc:WindowAttach.ShowInTaskManager" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="hc:ScreenshotWindow">
                    <AdornerDecorator>
                        <hc: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}">
                                <hc:SimplePanel>
                                    <Rectangle hc:TipElement.Placement="LeftTop" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
                                    <Rectangle hc:TipElement.Placement="Top" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
                                    <Rectangle hc:TipElement.Placement="RightTop" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
                                    <Rectangle hc:TipElement.Placement="Right" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
                                    <Rectangle hc:TipElement.Placement="RightBottom" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
                                    <Rectangle hc:TipElement.Placement="Bottom" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
                                    <Rectangle hc:TipElement.Placement="LeftBottom" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
                                    <Rectangle hc:TipElement.Placement="Left" Style="{StaticResource SnapRect4ScreenshotStyle}"/>
                                    <TextBlock Text="{TemplateBinding SizeStr}" Background="#CC212121" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="8,2"/>
                                </hc: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>
                                <hc:SimplePanel>
                                    <Border Margin="0,0,0,32" Background="{TemplateBinding PreviewBrush}" BorderThickness="2" BorderBrush="White">
                                        <hc: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"/>
                                        </hc: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>
                                </hc:SimplePanel>
                            </Border>
                        </hc:SimplePanel>
                    </AdornerDecorator>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>