<UserControl x:Class="DesktopMagic.Plugins.ModEntry"
             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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:local="clr-namespace:DesktopMagic.Plugins"
             xmlns:dataContext="clr-namespace:DesktopMagic.DataContexts"
             d:DataContext="{d:DesignInstance Type=dataContext:PluginEntryDataContext}"
             mc:Ignorable="d"
             d:DesignHeight="450" d:DesignWidth="800"
             Background="{DynamicResource MaterialDesignPaper}"
             FontFamily="{DynamicResource MaterialDesignFont}"
             Visibility="{Binding Visibility}">
    <Grid Background="White" Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="2*" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="3*" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Border HorizontalAlignment="Center" Margin="10" Width="100" Height="100" BorderThickness="1" BorderBrush="LightGray">
            <Image Source="{Binding Logo, FallbackValue={StaticResource ModioCogBlue}, TargetNullValue={StaticResource ModioCogBlue}}" Width="100" Height="100" />
        </Border>

        <StackPanel Grid.Column="1" VerticalAlignment="Center">
            <Label Content="{Binding Author}" HorizontalAlignment="Center" ContentStringFormat="{DynamicResource authorFormat}" />
            <Label Content="{Binding DateAdded}" HorizontalAlignment="Center" ContentStringFormat="{DynamicResource addedFormat}" />
            <Label Content="{Binding DateUpdated}" HorizontalAlignment="Center" ContentStringFormat="{DynamicResource updatedFormat}" />
            <Label Content="{Binding Version}" HorizontalAlignment="Center" ContentStringFormat="{DynamicResource versionFormat}" />
        </StackPanel>

        <Grid Grid.Row="1" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Button Grid.Column="0" Command="{Binding InstallUninstallButtonData.Command}" IsEnabled="{Binding InstallUninstallButtonData.IsEnabled}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="10 5 5 0">
                <StackPanel Orientation="Horizontal">
                    <materialDesign:PackIcon Kind="{Binding InstallUninstallButtonData.IconKind}" Margin="0 0 10 0" />
                    <TextBlock Text="{Binding InstallUninstallButtonData.Text}" />
                </StackPanel>
            </Button>
            <Button Grid.Column="1" Command="{Binding OpenButtonData.Command}" IsEnabled="{Binding OpenButtonData.IsEnabled}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="5 5 10 0">
                <StackPanel Orientation="Horizontal">
                    <materialDesign:PackIcon Kind="{Binding OpenButtonData.IconKind}" Margin="0 0 10 0" />
                    <TextBlock Text="{Binding OpenButtonData.Text}" />
                </StackPanel>
            </Button>
        </Grid>

        <StackPanel Grid.Row="2" Grid.ColumnSpan="2" Margin="10">
            <Label Content="{Binding Name}" FontSize="20" Padding="0" />
            <TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
        </StackPanel>
    </Grid>
</UserControl>