<Window x:Class="Dependencies.UserSettings"
        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:Dependencies"
        xmlns:properties="clr-namespace:Dependencies.Properties"
        xmlns:System="clr-namespace:System;assembly=mscorlib"
        mc:Ignorable="d"
        Title="UserSettings"
        Height="400" Width="700"
        WindowStartupLocation="CenterOwner">
    <Window.Resources>
        <local:TreeBuildingBehaviour x:Key="TreeBuildingBehaviourConverter"/>
    </Window.Resources>
    <Grid Margin="10 20 20 20" >

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        
        <!-- Previewer Path selection -->
        <Label Content="Peviewer path:"
               Margin="5"
               Grid.Column="0"
               Grid.Row="0"
               HorizontalAlignment="Left" 
               VerticalAlignment="Center" />

        <Grid Margin="5" Grid.Row="0" Grid.Column="1">

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBox Grid.Column="0"
                     Text="{Binding Source={x:Static properties:Settings.Default}, Path=PeViewerPath, Mode=OneWay}"
                     TextWrapping="Wrap" 
                     VerticalContentAlignment="Center" />

            <Button Margin="2 0 0 0"
                    Grid.Column="1"
                    Width="30"
                    Content="..."
                    Click="OnPeviewerPathSettingChange" />
        </Grid>

        
        <!-- Tree build behaviour selection -->
        <Label Margin="5" 
               Grid.Row="1"
               Grid.Column="0"
               Content="Tree build behaviour:" 
               HorizontalAlignment="Left" 
               VerticalAlignment="Center" />

        <ComboBox x:Name="TreeBuildCombo"
                  Margin="5"
                  Grid.Row="1"
                  Grid.Column="1" 
                  SelectedItem="{Binding Source={x:Static properties:Settings.Default}, Path=TreeBuildBehaviour, Mode=OneWay, Converter={StaticResource TreeBuildingBehaviourConverter}}"
                  />

        
        <!-- Font family selection -->
        <Label Margin="5"
               Grid.Row="2"
               Grid.Column="0"
               Content="Font family:" 
               HorizontalAlignment="Left" 
               VerticalAlignment="Top" />

        <ListBox Name="FontFamilyList"
                 Margin="5"
                 Grid.Row="2"
                 Grid.Column="1" />
        
        
        <!-- Buttons -->
        <StackPanel Grid.Row="3" Grid.Column="1" 
                    Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Content="Cancel" 
                    Height="20"
                    Width="60"
                    Margin="2"
                    Padding="2"
                    Click="OnCancel" />

            <Button Content="OK" 
                    Height="20"
                    Width="60"
                    Margin="2"
                    Padding="2"
                    Click="OnValidate" />
        </StackPanel>

    </Grid>
</Window>
