<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style TargetType="Button" x:Key="ButtonBase">

    </Style>
    <Style TargetType="Button" x:Key="CommandButton" BasedOn="{StaticResource ButtonBase}">
        <Style.Setters>
            <Setter Property="Height" Value="25"/>
        </Style.Setters>
    </Style>
    <Style TargetType="Button" x:Key="AddButton" BasedOn="{StaticResource CommandButton}">
        <Style.Setters>
            <Setter Property="Content" Value="Add"/>
            <Setter Property="Command" Value="{Binding Add}"/>
        </Style.Setters>
    </Style>
    <Style TargetType="Button" x:Key="EditButton" BasedOn="{StaticResource CommandButton}">
        <Style.Setters>
            <Setter Property="Content" Value="Edit"/>
            <Setter Property="Command" Value="{Binding Edit}"/>
        </Style.Setters>
    </Style>
    <Style TargetType="Button" x:Key="DeleteButton" BasedOn="{StaticResource CommandButton}">
        <Style.Setters>
            <Setter Property="Content" Value="Delete"/>
            <Setter Property="Command" Value="{Binding Delete}"/>
        </Style.Setters>
    </Style>
    <Style TargetType="Button" x:Key="CopyButton" BasedOn="{StaticResource CommandButton}">
        <Style.Setters>
            <Setter Property="Content" Value="Copy"/>
            <Setter Property="Command" Value="{Binding Copy}"/>
        </Style.Setters>
    </Style>
    <Style TargetType="Button" x:Key="OkButton" BasedOn="{StaticResource CommandButton}">
        <Style.Setters>
            <Setter Property="Content" Value="Ok"/>
            <Setter Property="IsDefault" Value="True"/>
            <Setter Property="Width" Value="60"/>
            <Setter Property="Margin" Value="5"/>
        </Style.Setters>
    </Style>
    <Style TargetType="Button" x:Key="CancelButton" BasedOn="{StaticResource CommandButton}">
        <Style.Setters>
            <Setter Property="Content" Value="Cancel"/>
            <Setter Property="IsCancel" Value="True"/>
            <Setter Property="Width" Value="60"/>
            <Setter Property="Margin" Value="5"/>
        </Style.Setters>
    </Style>

    <Style x:Key="ToolButton" TargetType="Button">
        <Style.Resources>
            <Style TargetType="Image">
                <Setter Property="Width" Value="32"/>
                <Setter Property="Height" Value="32"/>
                <Setter Property="Margin" Value="-2"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Style.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Opacity" Value="0.25"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style TargetType="Viewbox">
                <Setter Property="Margin" Value="-2"/>
                <Setter Property="Width" Value="32"/>
                <Setter Property="Height" Value="32"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="Stretch" Value="UniformToFill"/>
                <Style.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Opacity" Value="0.25"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </Style.Resources>
        <Setter Property="Width" Value="32"/>
        <Setter Property="Height" Value="32"/>
        <Setter Property="Margin" Value="2,0,2,0"/>
        <Setter Property="Background" Value="#FFA19BC3"/>
        <Setter Property="BorderBrush" Value="Black"/>
    </Style>

    <Style x:Key="ToolButton24" TargetType="Button" BasedOn="{StaticResource ToolButton}">
        <Setter Property="Height" Value="24"/>
        <Setter Property="Width" Value="24"/>
    </Style>

    <Style x:Key="ButtonImage16" TargetType="Image">
        <Setter Property="Height" Value="16"/>
        <Setter Property="Width" Value="16"/>
    </Style>
    <Style x:Key="ButtonImage32" TargetType="Image">
        <Setter Property="Height" Value="32"/>
        <Setter Property="Width" Value="32"/>
    </Style>

    <Color x:Key="ButtonLight" A="255" B="255" G="255" R="255"/>
    <Color x:Key="CalculatorColor" A="255" B="149" G="149" R="211"/>
    <Color x:Key="CalculatorFrameColor" A="255" B="109" G="109" R="166"/>
    <Color x:Key="ResultColor" A="255" B="200" G="200" R="200"/>
    <Color x:Key="ResultFrameColor" A="255" B="100" G="100" R="100"/>
    <SolidColorBrush x:Key="CalculatorCanvas" Color="{DynamicResource CalculatorColor}"/>
    <SolidColorBrush x:Key="CalculatorFrame" Color="{DynamicResource CalculatorFrameColor}"/>
    <SolidColorBrush x:Key="ResultCanvas" Color="{DynamicResource ResultColor}"/>
    <SolidColorBrush x:Key="ResultFrame" Color="{DynamicResource ResultFrameColor}"/>

    <Style x:Key="ButtonCanvas" TargetType="Canvas">
        <Setter Property="Width" Value="32"/>
        <Setter Property="Height" Value="32"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
    </Style>

    <Style x:Key="ButtonCalculatorCanvas" TargetType="Canvas" BasedOn="{StaticResource ButtonCanvas}">
        <Setter Property="Background" Value="{DynamicResource CalculatorCanvas}"/>
    </Style>

    <Style x:Key="ButtonResultCanvas" TargetType="Canvas" BasedOn="{StaticResource ButtonCanvas}">
        <Setter Property="Background" Value="{DynamicResource ResultCanvas}"/>
    </Style>

    <Style x:Key="ButtonRect" TargetType="Rectangle">
        <Setter Property="Margin" Value="3"/>
        <Setter Property="Width" Value="26"/>
        <Setter Property="Height" Value="26"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="StrokeThickness" Value="1"/>
    </Style>


    <DataTemplate x:Key="OkCancelButtons">
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Style="{StaticResource CancelButton}" Command="{Binding CancelCommand}"/>
            <Button Style="{StaticResource OkButton}" Command="{Binding OkCommand}"/>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="ButtonCalculatorRectangle">              
    <Rectangle Style="{DynamicResource ButtonRect}" Stroke="{DynamicResource CalculatorFrame}">
        <Rectangle.Fill>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="{DynamicResource ButtonLight}" Offset="0.2"/>
                <GradientStop Color="{DynamicResource CalculatorColor}" Offset="1"/>
            </LinearGradientBrush>
        </Rectangle.Fill>
    </Rectangle>
    </DataTemplate>

    <DataTemplate x:Key="ButtonResultRectangle">
        <Rectangle Style="{DynamicResource ButtonRect}" Stroke="{DynamicResource ResultFrame}">
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="{DynamicResource ButtonLight}" Offset="0.2"/>
                    <GradientStop Color="{DynamicResource ResultColor}" Offset="1"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
    </DataTemplate>

    <DataTemplate x:Key="DiagramCalculator">
        <Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
            <Canvas.Children>
                <ContentControl ContentTemplate="{DynamicResource ButtonCalculatorRectangle}"/>
                <Line Margin="4" X1="0" Y1="20" X2="25" Y2="20" StrokeThickness="1.5" Stroke="{DynamicResource CalculatorFrame}"/>
                <Line Margin="4" X1="4" Y1="0" X2="4" Y2="25" StrokeThickness="1.5" Stroke="{DynamicResource CalculatorFrame}"/>
                <Path Margin="4" Data="M 0 5 l 4 -4 l 7 4 l 7 6 l 2 4 l -2 7 l -2 2 " Stroke="{DynamicResource CalculatorFrame}"/>
                <TextBlock Margin="4,2,0,0" Text="M-N" Foreground="Black" FontSize="10" HorizontalAlignment="Stretch" FontWeight="Bold" />
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="CrackCalculator">
        <Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
            <Canvas.Children>
                <ContentControl ContentTemplate="{DynamicResource ButtonCalculatorRectangle}"/>
                <Path Margin="4" Data="M 0 0 l 25 0 l 0 20
                      l -4 0
                      l -1 -5 l 1 -5 l -2 5 l -2 5
                      l -3 0
                      l 0 -5 l 0 -10 l -2 10 l -2 5
                      l -3 0
                      l -1 -5 l 1 -5 l -2 5 l -2 5
                      l -4 0" Fill="{DynamicResource CalculatorFrame}"/>
                <TextBlock Margin="4,2,0,0" Text="Crc" Foreground="White" FontSize="10" HorizontalAlignment="Stretch" FontWeight="Bold" />
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="CalculatorRun">
        <Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
            <Canvas.Children>
                <ContentControl ContentTemplate="{DynamicResource ButtonCalculatorRectangle}"/>
                <Path Margin="4" Data="M 4 2 l 12 10 l -12 10 l 0 -20" Fill="{DynamicResource CalculatorFrame}"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="IsoFieldResult">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <ContentControl ContentTemplate="{DynamicResource ButtonResultRectangle}"/>
                <Path Margin="4" Data="M 0 0 h 20 A 20 20 90 0 1 0 24 z" Fill="Gray"/>
                <Path Margin="4" Data="M 0 0 h 16 A 16 16 90 0 1 0 18 z" Fill="DarkGray"/>
                <Path Margin="4" Data="M 0 0 h 10 A 10 10 90 0 1 0 10 z" Fill="LightGray"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="ShowRebarsResult">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <ContentControl ContentTemplate="{DynamicResource ButtonResultRectangle}"/>
                <Rectangle Canvas.Left="8" Canvas.Top="6" Width="16" Height="21" Fill="LightGray" Stroke ="Black"/>
                <Ellipse Canvas.Left="10" Canvas.Top="21" Width="4" Height="4" Fill="DarkGray" Stroke ="Black"/>
                <Ellipse Canvas.Left="18" Canvas.Top="21" Width="4" Height="4" Fill="DarkGray" Stroke ="Black"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="FileOpen">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <Path Margin="4" Data="M 2 6 l 8 0 l 3 3 l 6 0 l 0 12 l -17 0 z" Fill="DarkGray" Stroke="Black" StrokeThickness="1"/>
                <Path Margin="4" Data="M 6 12 l 20 0 l -5 10 l -19 0 z" Fill="LightGray" Stroke="Black" StrokeThickness="1"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="FileSave">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <Rectangle Height="26" Width="26" Canvas.Left="3" Canvas.Top="3"
                            Fill="DarkGray" Stroke="Black" StrokeThickness="1"
                            RadiusX="2" RadiusY="2"/>
                <Rectangle Height="8" Width="12" Canvas.Left="10" Canvas.Top="4"
                            Fill="LightGray" Stroke="Black" StrokeThickness="0.5"/>
                <Rectangle Height="6" Width="4" Canvas.Left="16" Canvas.Top="5"
                            Fill="DarkGray" Stroke="Black" StrokeThickness="0.5"/>
                <Rectangle Height="14" Width="22" Canvas.Left="5" Canvas.Top="13"
                            Fill="LightGray" Stroke="Black" StrokeThickness="0.5"
                            RadiusX="2" RadiusY="2"/>
                <Line X1="7" Y1="18" X2="24" Y2="18" Stroke="Black" StrokeThickness="0.5"/>
                <Line X1="7" Y1="21" X2="24" Y2="21" Stroke="Black" StrokeThickness="0.5"/>
                <Line X1="7" Y1="24" X2="24" Y2="24" Stroke="Black" StrokeThickness="0.5"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="Diagrams">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <Line X1="2" Y1="16" X2="30" Y2="16" Stroke="Black" StrokeThickness="0.5"/>
                <Line X1="16" Y1="2" X2="16" Y2="30" Stroke="Black" StrokeThickness="0.5"/>
                <Path Margin="2" Data="M 0 21 l 6 0 l 9 -8 l 9 -8 l 4 0" Stroke="Black" StrokeThickness="1"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="NdmCrossSection">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <Rectangle Height="16" Width="8" Canvas.Left="12" Canvas.Top="12"
                            Fill="DarkGray" Stroke="Black" StrokeThickness="1"/> 
                <Rectangle Height="6" Width="16" Canvas.Left="8" Canvas.Top="7"
                            Fill="LightGray" Stroke="Black" StrokeThickness="1"/>
                <Line X1="2" Y1="16" X2="30" Y2="16" Stroke="Black" StrokeThickness="0.5"/>
                <Line X1="16" Y1="2" X2="16" Y2="30" Stroke="Black" StrokeThickness="0.5"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="SelectAll">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <CheckBox Canvas.Left="13" Canvas.Top="13" IsChecked="True" IsEnabled="False"/>
                <CheckBox Canvas.Left="2" Canvas.Top="2" IsChecked="True" IsEnabled="False"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="DeSelectAll">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <CheckBox Canvas.Left="13" Canvas.Top="13" IsChecked="False" IsEnabled="False"/>
                <CheckBox Canvas.Left="2" Canvas.Top="2" IsChecked="False" IsEnabled="False"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>
    
    <DataTemplate x:Key="InvertSelection">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <CheckBox Canvas.Left="13" Canvas.Top="13" IsChecked="True" IsEnabled="False"/>
                <CheckBox Canvas.Left="2" Canvas.Top="2" IsChecked="False" IsEnabled="False"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="RunAnalisis">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <Path Margin="4" Data="M 4 2 l 12 10 l -12 10 z" Fill="DarkGray" Stroke="Black" StrokeThickness="1"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="EditAnalisis">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <Path Margin="4" Data="M 2 22 l 4 -6 l 15 -16 l 4 4 l -15 14 z" Fill="DarkGray" Stroke="Black" StrokeThickness="1"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

    <DataTemplate x:Key="DeleteAnalisis">
        <Canvas Style="{DynamicResource ButtonResultCanvas}">
            <Canvas.Children>
                <Line X1="4" Y1="4" X2="26" Y2="26" Stroke="Black" StrokeThickness="2"/>
                <Line X1="4" Y1="26" X2="26" Y2="4" Stroke="Black" StrokeThickness="2"/>
            </Canvas.Children>
        </Canvas>
    </DataTemplate>

</ResourceDictionary>