<Window x:Class="StructureHelper.Windows.Forces.ForceCombinationViewerView"
        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.Forces"
        xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
        d:DataContext="{d:DesignInstance local:ForceCombinationViewerVM}"
        mc:Ignorable="d"
        Title="Force Combination Viewer" Height="450" Width="550" MinHeight="450" MinWidth="400" MaxHeight="800" MaxWidth="1000" ResizeMode="CanResize" WindowStartupLocation="CenterScreen">
    <DockPanel>
        <ToolBarTray DockPanel.Dock="Top">
            <ToolBar>
                <Button Style="{StaticResource ToolButton}" Command="{Binding RefreshCommand}">
                    <Button.ToolTip>
                        <uc:ButtonToolTipEh HeaderText="Refresh combination"
                                IconContent="{StaticResource Renew}"
                                DescriptionText="Refreshes combination according to selected filters"/>
                    </Button.ToolTip>
                    <Viewbox>
                        <ContentControl ContentTemplate="{StaticResource Renew}"/>
                    </Viewbox>
                </Button>
                <ComboBox Grid.Row="0" Grid.Column="1" ItemsSource="{Binding LimitStateList}" SelectedItem="{Binding LimitState}" Width="100"/>
                <ComboBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding CalcTermList}" SelectedItem="{Binding CalcTerm}" Width="100"/>
            </ToolBar>
        </ToolBarTray>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="25"/>
            </Grid.RowDefinitions>
            <DataGrid x:Name="ForceGrid" Style="{StaticResource ItemsDataGrid}" ItemsSource="{Binding Combinations}">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Limit state" Width="80" MinWidth="70" Binding="{Binding LimitState}"/>
                    <DataGridTextColumn Header="Duration" Width="80" MinWidth="70" Binding="{Binding CalcTerm}"/>
                    <DataGridTextColumn Header="Moment Mx" Width="100" Binding="{Binding ForceTuple.Mx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
                    <DataGridTextColumn Header="Moment My" Width="100" Binding="{Binding ForceTuple.My, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
                    <DataGridTextColumn Header="Force Nz" Width="100" Binding="{Binding ForceTuple.Nz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
                </DataGrid.Columns>
            </DataGrid>
            <StatusBar Grid.Row="1">
                <StatusBarItem>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Total number of combinations: "/>
                        <TextBlock Text="{Binding RowsNumber}"/>
                    </StackPanel>
                </StatusBarItem>
            </StatusBar>
        </Grid>
    </DockPanel>
</Window>
