<Window x:Class="StructureHelper.Windows.CalculationWindows.ProgressViews.TraceDocumentView"
        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.ProgressViews"
        xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
        d:DataContext="{d:DesignInstance local:TraceDocumentVM}"
        mc:Ignorable="d"
        Title="Document Viewer" Height="600" Width="800" MinHeight="400" MinWidth="600" WindowStartupLocation="CenterScreen">
    <Grid>
        <DockPanel>
            <ToolBarTray DockPanel.Dock="Top">
                <ToolBar>
                    <Button Style="{StaticResource ToolButton}" 
                        Command="{Binding PrintDocumentCommand}">
                        <Button.ToolTip>
                            <uc:ButtonToolTipEh HeaderText="Print"
                                                IconContent="{StaticResource Print}"
                                                DescriptionText="Print current document to phisical or virtual printer"/>
                        </Button.ToolTip>
                        <Viewbox>
                            <ContentControl ContentTemplate="{DynamicResource Print}"/>
                        </Viewbox>
                    </Button>
                </ToolBar>
                <ToolBar>
                    <StackPanel Grid.Column="1" Orientation="Horizontal">
                        <GroupBox Width="100" Header="Tab gap">
                            <TextBox Height="22" Text="{Binding TabGap, ValidatesOnExceptions=True}" VerticalAlignment="Top" />
                        </GroupBox>
                        <GroupBox Header="Max priority">
                            <StackPanel>
                                <TextBox Text="{Binding PriorityLimit, ValidatesOnExceptions=True}" />
                                <StackPanel Orientation="Horizontal">
                                    <Slider Width="88" Value="{Binding PriorityLimit}" Maximum="{Binding MaxPriority}" Minimum="0"/>
                                    <TextBlock Width="20" FontSize="8" Text="{Binding MaxPriority}"/>
                                </StackPanel>
                            </StackPanel>
                        </GroupBox>
                    </StackPanel>
                    <Button Style="{StaticResource ToolButton}" 
                        Command="{Binding RebuildCommand}">
                        <Button.ToolTip>
                            <uc:ButtonToolTipEh HeaderText="Rebuild document"
                                                IconContent="{StaticResource Renew}"
                                                DescriptionText="Rebuild current document considering new values of gap and priority"/>
                        </Button.ToolTip>
                        <Viewbox>
                            <ContentControl ContentTemplate="{StaticResource Renew}"/>
                        </Viewbox>
                    </Button>
                </ToolBar>
            </ToolBarTray>
            <Grid>
                <FlowDocumentReader Name="DocumentReader" ViewingMode="Scroll"/>
            </Grid>
        </DockPanel>
    </Grid>
</Window>
