<Controls:MetroWindow x:Name="MainWindow1" x:Class="WPFCatalog.MainWindow"
        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:wpfCatalog="clr-namespace:WPFCatalog"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
        xmlns:controls="clr-namespace:WPFCatalog.Controls"
        xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
        mc:Ignorable="d" 

        Title="Image Catalog" Height="466" Width="772" 
        d:DataContext="{d:DesignInstance wpfCatalog:MainWindowViewModel}"
        >
    <!--d:DataContext="{d:DesignInstance wpfCatalog:MainWindowViewModel}"-->
    <Window.Resources>
        <Style x:Key="CommonStyle" TargetType="FrameworkElement">
            <Setter Property="Margin" Value="4" />
        </Style>
        <Style TargetType="TextBox" BasedOn="{StaticResource CommonStyle}"></Style>
        <Style TargetType="Button" >
            <Setter Property="Margin" Value="2,2,5,5" />
        </Style>
        <Style TargetType="ComboBox" BasedOn="{StaticResource CommonStyle}"></Style>

    </Window.Resources>
    <Grid>
        <DockPanel LastChildFill="True">
            <Menu DockPanel.Dock="Top" Height="auto">
                <MenuItem Header="Files"/>
                <MenuItem Header="Modifica"></MenuItem>
                <MenuItem Header="?"></MenuItem>
            </Menu>
            <StatusBar DockPanel.Dock="Bottom" Height="auto">
                <StatusBarItem>
                    <ProgressBar Width="510" Height="10">

                    </ProgressBar>
                </StatusBarItem>
            </StatusBar>
            <DockPanel  >
                <!--<Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
            </Grid.RowDefinitions>-->
                <Controls:MetroAnimatedTabControl DockPanel.Dock="Left" Width="520">
                    <TabItem>
                        <TabItem.Header>
                            <StackPanel Orientation="Horizontal">

                                <TextBlock Text="Generale" Margin="0,0,5,0" VerticalAlignment="Center"/>
                                <iconPacks:PackIconMaterial Kind="Camera" VerticalAlignment="Center"/>
                            </StackPanel>
                        </TabItem.Header>
                        <controls:GeneralSettingsControl ></controls:GeneralSettingsControl>
                    </TabItem>
                    <TabItem>
                        <TabItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <Label Content="Testo" VerticalAlignment="Center"/>
                                <iconPacks:PackIconMaterial Kind="Textbox" VerticalAlignment="Center" />
                            </StackPanel>
                        </TabItem.Header>
                        <controls:TextSettingsControl></controls:TextSettingsControl>

                    </TabItem>
                    <TabItem>
                        <TabItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <Label VerticalAlignment="Center" Content="Miniature" VerticalContentAlignment="Center"/>
                                <iconPacks:PackIconMaterial Kind="Image" VerticalAlignment="Center"/>
                            </StackPanel>
                        </TabItem.Header>
                        <WrapPanel>
                            <GroupBox Header="Miniature">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition Width="100"/>
                                    </Grid.ColumnDefinitions>
                                    <Label Grid.Row="0" Grid.Column="0" Content="Suffisso" />
                                    <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding MiniatureSuffisso}"/>

                                    <Label Grid.Row="1" Grid.Column="0" Content="Larghezza" />
                                    <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding MiniatureLarghezza}"/>

                                    <Label Grid.Row="2" Grid.Column="0" Content="Altezza" />
                                    <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding MiniatureAltezza}"/>

                                    <Label Grid.Row="3" Grid.Column="0" Content="Qualità" />
                                    <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding MiniatureQualita}"/>
                                </Grid>
                            </GroupBox>
                            <GroupBox Header="Testo Miniature" >
                                <WrapPanel Orientation="Vertical" >
                                    <RadioButton Content="Aggiungi Scritta" Margin="4,2,4,2" IsChecked="{Binding TestoMinAggiungiScritta}" />
                                    <RadioButton Content="Aggiungi Orario" Margin="4,2,4,2" IsChecked="{Binding TestoMinAggiungiOrario}"/>
                                    <RadioButton Content="Tempo Gara" Margin="4,2,4,2" IsChecked="{Binding TestoMinTempoGara}"/>
                                    <RadioButton Content="Numero Foto" Margin="4,2,4,2" IsChecked="{Binding TestoMinNumeroFoto}"/>
                                    <RadioButton Content="Numero + Tempo" Margin="4,2,4,2" IsChecked="{Binding TestoMinNumeroTempo}"></RadioButton>
                                </WrapPanel>
                            </GroupBox>
                        </WrapPanel>

                    </TabItem>
                    <TabItem>
                        <TabItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <Label VerticalAlignment="Center" Content="Logo" />
                                <iconPacks:PackIconFontAwesome Kind="SmileOutline" VerticalAlignment="Center"/>
                            </StackPanel>
                        </TabItem.Header>

                        <WrapPanel>
                            <GroupBox Header="Logo">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="50" />
                                        <ColumnDefinition Width="50"/>
                                        <ColumnDefinition Width="200"/>
                                        <ColumnDefinition Width="30"/>
                                    </Grid.ColumnDefinitions>
                                    <Label Grid.Row="0" Grid.Column="0" Content="Percorso Immagine"/>
                                    <TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding LogoPercorsoImmagine}"/>
                                    <Button Grid.Row="0" Grid.Column="4" Content="..." Command="{Binding ScegliLogoCommand}" />

                                    <Label Grid.Row="1" Grid.Column="0" Content="Altezza" />
                                    <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding LogoAltezza}" />

                                    <Label Grid.Row="2" Grid.Column="0" Content="Larghezza" />
                                    <TextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding LogoLarghezza}" />

                                    <Label Grid.Row="3" Grid.Column="0" Content="Trasparenza (0-100%)" />
                                    <TextBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding LogoTrasparenza}" />

                                    <Label Grid.Row="4" Grid.Column="0" Content="Margine (pixel %)" />
                                    <TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding LogoMargine}" />

                                    <Label Grid.Row="5" Grid.Column="0" Content="Posizione Orizzontale" />
                                    <ComboBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" />
                                    <!--todo-->

                                    <Label Grid.Row="6" Grid.Column="0" Content="Posizione Verticale" />
                                    <ComboBox Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2"  />
                                    <!--todo-->

                                    <Label Grid.Row="7" Grid.Column="0" Content="Colore Trasparente" />
                                    <Image Grid.Row="7" Grid.Column="1" Width="24" Height="24" HorizontalAlignment="Left" />
                                    <Image Grid.Row="7" Grid.Column="8" Width="24" Height="24" HorizontalAlignment="Right" />

                                    <Image Grid.Row="1" Grid.Column="3" Grid.RowSpan="7" />

                                </Grid>
                            </GroupBox>
                        </WrapPanel>

                    </TabItem>
                </Controls:MetroAnimatedTabControl>
                <StackPanel DockPanel.Dock="Right" Orientation="Vertical">
                    <GroupBox DockPanel.Dock="Right" Header="Statistiche">
                        <StackPanel Orientation="Vertical">
                            <StackPanel Orientation="Horizontal">
                                <Button Content="Carica Impostazioni" Command="{Binding ImportSettingsCommand}" Style="{DynamicResource SquareButtonStyle}" IsEnabled="{Binding IsUiActive}"></Button>
                                <Button Content="Salva Impostazioni" Command="{Binding ExportSettingsCommand}" Style="{DynamicResource SquareButtonStyle}" IsEnabled="{Binding IsUiActive}"></Button>
                            </StackPanel>
                            <Button Content="Start" Command="{Binding StartCommand}" Style="{DynamicResource AccentedSquareButtonStyle}" IsEnabled="{Binding IsUiActive}"></Button>
                            <Button Content="STOP" Command="{Binding StopCommand}" Style="{DynamicResource SquareButtonStyle}"/>
                            <TextBlock Text="{Binding CurrentImage}"></TextBlock>
                            <TextBlock Text="{Binding TotalPictures}"></TextBlock>
                        </StackPanel>

                    </GroupBox>
                </StackPanel>

            </DockPanel>

        </DockPanel>

    </Grid>

</Controls:MetroWindow>
