<Window x:Class="StructureHelper.Windows.BeamShears.BeamShearActionResultView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:StructureHelper.Windows.BeamShears"
        xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
        d:DataContext="{d:DesignInstance local:BeamShearActionResultViewModel}"
        mc:Ignorable="d"
        Title="Shear sections result" Height="450" Width="800" MinHeight="400" MinWidth="600" MaxHeight="900" MaxWidth="1200" WindowStartupLocation="CenterScreen">
    <DockPanel>
        <ToolBarTray DockPanel.Dock="Top">
            <ToolBar Name="Sections">
                <Button Style="{DynamicResource ToolButton}" Command="{Binding ShowTraceCommand}">
                    <Button.ToolTip>
                        <uc:ButtonToolTipEh HeaderText="Show trace"
                                                IconContent="{StaticResource Report}"
                                                DescriptionText="Shows trace for selected inclined section"/>
                    </Button.ToolTip>
                    <Viewbox>
                        <ContentControl ContentTemplate="{StaticResource Report}"/>
                    </Viewbox>
                </Button>
                <Button Style="{DynamicResource ToolButton}" Command="{Binding ShowDiagramCommand}">
                    <Button.ToolTip>
                        <uc:ButtonToolTipEh HeaderText="Show digram"
                                                IconContent="{StaticResource MomentCurvatureDiagram}"
                                                DescriptionText="Shows diagram for result where inclined section is started from selected result start point"/>
                    </Button.ToolTip>
                    <Viewbox>
                        <ContentControl ContentTemplate="{StaticResource MomentCurvatureDiagram}"/>
                    </Viewbox>
                </Button>
                <Button Style="{DynamicResource ToolButton}" Command="{Binding ShowGraphResultsCommand}">
                    <Button.ToolTip>
                        <uc:ButtonToolTipEh HeaderText="Show inclined section"
                                                IconContent="{StaticResource BeamShearInclinedSection}"
                                                DescriptionText="Shows graphical results for inclined section"/>
                    </Button.ToolTip>
                    <Viewbox>
                        <ContentControl ContentTemplate="{StaticResource BeamShearInclinedSection}"/>
                    </Viewbox>
                </Button>
            </ToolBar>
        </ToolBarTray>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="22"/>
            </Grid.RowDefinitions>
            <DataGrid x:Name="ResultGrid" IsReadOnly="True" AutoGenerateColumns="False"  ItemsSource="{Binding SectionResults}" SelectedItem="{Binding SelectedResult}" >
                <DataGrid.RowStyle>
                    <Style TargetType="DataGridRow">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsValid}" Value="false">
                                <Setter Property="Background" Value="Pink"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </DataGrid.RowStyle>
                <DataGrid.Columns>
                    <DataGridCheckBoxColumn Header="Valid" Binding="{Binding IsValid}"/>
                    <DataGridTextColumn Header="Start point" Width="100" Binding="{Binding InputData.InclinedSection.StartCoord, Converter={StaticResource LengthConverter}}"/>
                    <DataGridTextColumn Header="End point" Width="100" Binding="{Binding InputData.InclinedSection.EndCoord, Converter={StaticResource LengthConverter}}"/>
                    <DataGridTextColumn Header="Shear force" Width="120" Binding="{Binding InputData.ForceTuple.Qy, Converter={StaticResource ForceConverter}}"/>
                    <DataGridTextColumn Header="Limit force" Width="120" Binding="{Binding TotalStrength, Converter={StaticResource ForceConverter}}"/>
                    <DataGridTextColumn Header="Using factor" Width="120" Binding="{Binding FactorOfUsing, Converter={StaticResource PlainDouble}}"/>
                    <DataGridTextColumn Header="Concrete force" Width="120" Binding="{Binding ConcreteStrength, Converter={StaticResource ForceConverter}}"/>
                    <DataGridTextColumn Header="Stirrup force" Width="120" Binding="{Binding StirrupStrength, Converter={StaticResource ForceConverter}}"/>
                    <DataGridTextColumn Header="Description" Width="300" Binding="{Binding Description}"/>
                </DataGrid.Columns>
            </DataGrid>
            <ContentControl Grid.Row="1" ContentTemplate="{StaticResource ResultValidness}" Content="{Binding ValidResultCounter}"/>
        </Grid>
    </DockPanel>
</Window>
