<Window x:Class="UrlTester.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:local="clr-namespace:DT3"
        mc:Ignorable="d"
        Title="MainWindow"
        Height="450"
        Width="800">
    <Window.Resources>
        <Style x:Key="CommonStyle" TargetType="FrameworkElement">
            <Setter Property="Margin" Value="10" />
        </Style>
        <Style TargetType="Button" BasedOn="{StaticResource CommonStyle}">
            <Setter Property="Padding"
                    Value="15,0,15,0" />
        </Style>
        <Style TargetType="TextBox" BasedOn="{StaticResource CommonStyle}" />
        <Style TargetType="TextBlock" BasedOn="{StaticResource CommonStyle}" />
        <Style TargetType="ProgressBar" BasedOn="{StaticResource CommonStyle}">
            <Setter Property="Height"
                    Value="20" />
        </Style>
    </Window.Resources>
    <Border>
        <Grid>
            <StackPanel Orientation="Vertical">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Button Content="GetUrl"
                            IsDefault="true" />
                    <TextBox Grid.Column="2"
                             Text="{Binding Url, Mode=OneWayToSource}" />
                </Grid>
                <StackPanel Orientation="Horizontal">
                    <StackPanel.Resources>
                        <Style TargetType="TextBlock" BasedOn="{StaticResource CommonStyle}">
                            <Setter Property="Background"
                                    Value="LightGray" />
                            <Setter Property="Width"
                                    Value="150" />
                            <Setter Property="Padding"
                                    Value="5"/>
                        </Style>
                    </StackPanel.Resources>
                    <TextBlock Text="{Binding Size, StringFormat={}{0} bytes}" />
                    <TextBlock Text="{Binding Time, StringFormat={}{0} ms}" />
                </StackPanel>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <ProgressBar x:Name="timeBar"
                                 Minimum="0"
                                 Maximum="1000"
                                 Value="{Binding Time}"
                                 Grid.ColumnSpan="3" />
                    <TextBlock Grid.Row="1"
                               Grid.Column="1"
                               TextAlignment="Center"
                               Text="500 ms" />
                    <TextBlock Grid.Row="1"
                               Grid.Column="2"
                               TextAlignment="Right"
                               Text="1000 ms" />
                </Grid>
            </StackPanel>
        </Grid>
    </Border>
</Window>