<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
                    xmlns:mouseEventTriggers="clr-namespace:StructureHelper.Infrastructure.UI.Triggers.MouseEventTriggers"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:dataContexts="clr-namespace:StructureHelper.Infrastructure.UI.DataContexts"
                    xmlns:converters ="clr-namespace:StructureHelper.Infrastructure.UI.Converters.Units"
                    mc:Ignorable="d" >
    
    <converters:Length x:Key="LengthConverter"/>
    <converters:Area x:Key="AreaConverter"/>

    <Style TargetType="TextBox" x:Key="ValidatedError">
        <Style.Triggers>
            <Trigger Property="Validation.HasError" Value="True">
                <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type Shape}" x:Key="ShapeStyle">
        <Setter Property="Tag" Value="{Binding}"/>
        <Setter Property="Fill">
            <Setter.Value>
                <SolidColorBrush Color="{Binding Color}"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Opacity" Value="{Binding Opacity, Mode=TwoWay}"/>
        <Setter Property="Stroke" Value="Black"/>
        <Setter Property="StrokeThickness" Value="0.001"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Stroke" Value="Red"/>
                <Setter Property="StrokeThickness" Value="0.002"/>
            </Trigger>
            <!--<Trigger Property="IsVisible" Value="False">
                <Setter Property="Visibility" Value="Hidden"/>
            </Trigger>-->
        </Style.Triggers>
    </Style>

    <Style x:Key="PolygonStyle" TargetType="Path" BasedOn="{StaticResource ShapeStyle}">
        <Style.Setters>
            <Setter Property="Data" Value="{Binding PathGeometry}"/>
        </Style.Setters>
    </Style>

    <Style x:Key="EllipseStyle" TargetType="Ellipse" BasedOn="{StaticResource ShapeStyle}">
        <Style.Setters>
            <Setter Property="Width" Value="{Binding Diameter}"/>
            <Setter Property="Height" Value="{Binding Diameter}"/>
        </Style.Setters>
    </Style>

    <Style x:Key="RectangleStyle" TargetType="Rectangle" BasedOn="{StaticResource ShapeStyle}">
        <Setter Property="Width" Value="{Binding PrimitiveWidth}"/>
        <Setter Property="Height" Value="{Binding PrimitiveHeight}"/>
    </Style>

    <Style x:Key="LinePrimitiveStyle" TargetType="Line" BasedOn="{StaticResource ShapeStyle}">
        <Setter Property="X1" Value="{Binding StartPoinX}"/>
        <Setter Property="Y1" Value="{Binding StartPoinY}"/>
        <Setter Property="X2" Value="{Binding EndPoinX}"/>
        <Setter Property="Y2" Value="{Binding EndPoinY}"/>
    </Style>
</ResourceDictionary>