<UserControl x:Class="XamlViewer.Views.StatusControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:prism="http://prismlibrary.com/"
             xmlns:themes="clr-namespace:XamlTheme;assembly=XamlTheme"
             prism:ViewModelLocator.AutoWireViewModel="True">
    <Grid TextBlock.FontSize="12" TextBlock.Foreground="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition MinWidth="30" Width="auto"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition MinWidth="30" Width="auto"/>
            <ColumnDefinition Width="auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Text="{Binding CurrentStatus}" Margin="5,0,0,0" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>

        <TextBlock Grid.Column="1" Text="Ln" VerticalAlignment="Center"/>
        <TextBlock Grid.Column="2" Text="{Binding CaretLine}" Margin="5,0,0,0" VerticalAlignment="Center"/>

        <TextBlock Grid.Column="4" Text="Col" VerticalAlignment="Center"/>
        <TextBlock Grid.Column="5" Text="{Binding CaretColumn}" Margin="5,0,0,0" VerticalAlignment="Center"/>

        <Button Grid.Column="6" Margin="15,0,0,0" Padding="8,0" FontSize="12"
                ToolTipService.ShowDuration="10000"
                Command="{Binding DataContext.DownloadCommand,RelativeSource={RelativeSource AncestorType=UserControl}}"
                Style="{StaticResource {x:Static themes:ResourceKeys.StatusbarButtonStyleKey}}"
                Visibility="{Binding Info,FallbackValue={x:Static Visibility.Collapsed},Converter={StaticResource stringToVisibilityConverter}}">
            <Button.DataContext>
                <MultiBinding Converter="{StaticResource versionInfoMultiConverter}">
                    <Binding Path="ReleaseVersion"/>
                    <Binding Path="CurrentVersion"/>
                </MultiBinding>
            </Button.DataContext>
            <Button.ToolTip>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Grid.Column="0" Text="Latest Version: "/>
                    <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Version}" HorizontalAlignment="Left"/>

                    <TextBlock Grid.Row="1" Grid.Column="0" Text="Total Downloads: "/>
                    <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Downloads}" HorizontalAlignment="Left"/>

                    <TextBlock Grid.Row="2" Grid.ColumnSpan="2" Text="Changes: " HorizontalAlignment="Left"/>
                    <TextBlock Grid.Row="3" Grid.ColumnSpan="2" Text="{Binding Note}" HorizontalAlignment="Left"/>
                </Grid>
            </Button.ToolTip>
            <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                <Path Stretch="Fill" Width="16" Height="15" Fill="White" Data="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z" />    
                <Ellipse Height="7" Width="7" StrokeThickness="1" Stroke="White" Fill="Red" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-1,-1,0"/>
            </Grid>
        </Button>
    </Grid>
</UserControl>
