<Window x:Class="SparkleShare.SparkleEventLogWindow"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:sparkleShare="clr-namespace:SparkleShare"
        mc:Ignorable="d" 
             Height="640" SizeToContent="WidthAndHeight" Title="Recent Changes" MinHeight="640" MinWidth="490">
    <Grid x:Name="grid_Base" Background="White">
        <Border VerticalAlignment="Top" Height="35" Background="#FFF0F0F0" BorderBrush="#FFDFDFDF" BorderThickness="0,0,0,1">
            <Grid>
                <Label Content="Size: ?" Height="28" Name="label_Size" HorizontalAlignment="Left" Margin="20,0,0,0" FontWeight="Bold" />
                <Label Content="History: ?" Height="28" Name="label_History" HorizontalAlignment="Left" Margin="100,0,0,0" FontWeight="Bold" />
                <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,6,0" MinWidth="120" x:Name="combobox" />
            </Grid>
        </Border>
        
        <Grid Margin="0, 35, 0, 0">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <sparkleShare:SparkleSpinner x:Name="spinner" />
            <WebBrowser  x:Name="webbrowser" Height="{Binding ElementName=sizingControlHeight, Path=ActualHeight}" Width="{Binding ElementName=sizingControlWidth, Path=ActualWidth}" />

            <!-- WPF always resizes from child to parent. Unfortunately the webbrowser takes all space it gets.
                 To correct this "feature" we use a dummy control in a different column to bind the height to.
                 See: http://stackoverflow.com/questions/7300975/prevent-parent-from-being-resized-by-child -->
            <Rectangle Name="sizingControlHeight" Grid.Column="1" Visibility="Hidden" />
            <Rectangle Name="sizingControlWidth" Grid.Column="0" Grid.Row="1" Visibility="Hidden" />
        </Grid>               
    </Grid>
</Window>