<Window x:Class="StructureHelper.Windows.CalculationWindows.CalculatorsViews.ValueDiagrams.ValueDiagramCalculatorView"
        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.CalculationWindows.CalculatorsViews.ValueDiagrams"
        xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
        xmlns:enums="clr-namespace:StructureHelper.Infrastructure.Enums"
        d:DataContext="{d:DesignInstance local:ValueDiagramCalculatorViewModel}"
        mc:Ignorable="d"
        Title="Value Diagram Calculator" Height="250" Width="400" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Closing="Window_Closing">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>
        <TabControl>
            <TabItem Header="Main">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="22"/>
                        <RowDefinition Height="22"/>
                        <RowDefinition Height="22"/>
                        <RowDefinition Height="22"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Text="Name"/>
                    <TextBox Grid.Column="1" Grid.Row="0" Text="{Binding CalculatorViewModel.Name}"/>
                    <TextBlock Grid.Row="1" Text="Show trace data"/>
                    <CheckBox Grid.Column="1" Grid.Row="1" Margin="0,3" IsChecked="{Binding CalculatorViewModel.ShowTraceData}"/>
                    <TextBlock Grid.Row="2" Text="Limit state"/>
                    <ComboBox Grid.Column="1" Grid.Row="2" ItemsSource="{Binding InputDataViewModel.StateCalcTermPairViewModel.LimitStatesCollection}" SelectedItem="{Binding InputDataViewModel.StateCalcTermPairViewModel.LimitState}"/>
                    <TextBlock Grid.Row="3" Text="Calc term"/>
                    <ComboBox Grid.Column="1" Grid.Row="3" ItemsSource="{Binding InputDataViewModel.StateCalcTermPairViewModel.CalcTermsCollection}" SelectedItem="{Binding InputDataViewModel.StateCalcTermPairViewModel.CalcTerm}"/>
                </Grid>
            </TabItem>
            <TabItem Header="Forces">
                <ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding InputDataViewModel.CombinationViewModel}"/>
            </TabItem>
            <TabItem Header="Primitives">
                <ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding InputDataViewModel.PrimitivesViewModel}"/>
            </TabItem>
            <TabItem Header="Value diagrams" DataContext="{Binding InputDataViewModel.ValueDiagramsViewModel}">
                <DockPanel>
                    <ToolBarTray DockPanel.Dock="Top">
                        <ToolBar Name="Add">
                            <Button Style="{DynamicResource ToolButton24}" Command="{Binding Add}">
                                <Button.ToolTip>
                                    <uc:ButtonToolTipEh HeaderText="Add vertex"
                                        IconContent="{StaticResource AddEntity}"
                                        DescriptionText="Adds new vertex in the and of polygon"/>
                                </Button.ToolTip>
                                <Viewbox>
                                    <ContentControl ContentTemplate="{StaticResource AddEntity}"/>
                                </Viewbox>
                            </Button>
                            <Button Style="{StaticResource ToolButton24}" Command="{Binding Copy}">
                                <Button.ToolTip>
                                    <uc:ButtonToolTipEh HeaderText="Copy Analysis"
                        IconContent="{StaticResource CopyAnalysis}"
                        DescriptionText="Creates copy of selected analysis"/>
                                </Button.ToolTip>
                                <Viewbox Width="24" Height="24">
                                    <ContentControl ContentTemplate="{DynamicResource CopyAnalysis}"/>
                                </Viewbox>
                            </Button>
                            <Button Style="{StaticResource ToolButton24}" Command="{Binding Edit}">
                                <Button.ToolTip>
                                    <uc:ButtonToolTipEh HeaderText="Edit Analysis"
                                                IconContent="{StaticResource EditAnalysis}"
                                                DescriptionText="Edit selected analysis"/>
                                </Button.ToolTip>
                                <Viewbox Width="24" Height="24">
                                    <ContentControl ContentTemplate="{DynamicResource EditAnalysis}"/>
                                </Viewbox>
                            </Button>
                        </ToolBar>
                        <ToolBar Name="Delete">
                            <Button Style="{DynamicResource ToolButton24}" Command="{Binding Delete}">
                                <Button.ToolTip>
                                    <uc:ButtonToolTipEh HeaderText="Delete digram"
                                        IconContent="{StaticResource TableRowDelete}"
                                        DescriptionText="Removes selected vertex"/>
                                </Button.ToolTip>
                                <Viewbox Width="24" Height="24">
                                    <ContentControl ContentTemplate="{DynamicResource DeleteEntity}"/>
                                </Viewbox>
                            </Button>
                        </ToolBar>
                    </ToolBarTray>
                    <ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="20"/>
                                        <ColumnDefinition Width="200"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <CheckBox IsChecked="{Binding IsTaken}"/>
                                    <TextBlock Grid.Column="1" Text="{Binding Name}"/>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </DockPanel>
            </TabItem>
        </TabControl>
        <ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
    </Grid>
</Window>
