<UserControl xmlns="https://github.com/avaloniaui"
             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:profile="clr-namespace:Artemis.UI.Screens.Workshop.Profile"
             xmlns:mdxaml="https://github.com/whistyun/Markdown.Avalonia.Tight"
             xmlns:ui="clr-namespace:Artemis.UI"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="Artemis.UI.Screens.Workshop.Profile.ProfileDescriptionView"
             x:DataType="profile:ProfileDescriptionViewModel">
    <UserControl.Resources>
        <ui:ArtemisLinkCommand x:Key="ArtemisLinkCommand" />
    </UserControl.Resources>
    <StackPanel Spacing="10">
        <Border Classes="card">
            <ContentControl Content="{CompiledBinding ReleaseInfoViewModel}"/>
        </Border>
        
        <Border Classes="card">
            <mdxaml:MarkdownScrollViewer Markdown="{CompiledBinding Entry.Description}" MarkdownStyleName="FluentAvalonia" Name="MarkdownScrollViewer" >
                <mdxaml:MarkdownScrollViewer.Engine>
                    <mdxaml:Markdown HyperlinkCommand="{StaticResource ArtemisLinkCommand}" />
                </mdxaml:MarkdownScrollViewer.Engine>
                <mdxaml:MarkdownScrollViewer.Styles>
                    <StyleInclude Source="/Styles/Markdown.axaml" />
                </mdxaml:MarkdownScrollViewer.Styles>
            </mdxaml:MarkdownScrollViewer>
        </Border>

        <Border Classes="card" VerticalAlignment="Top" IsVisible="{CompiledBinding Dependencies, Converter={x:Static ObjectConverters.IsNotNull}}">
            <StackPanel>
                <TextBlock Theme="{StaticResource SubtitleTextBlockStyle}">Required plugins</TextBlock>
                <Border Classes="card-separator" />
                <ScrollViewer>
                    <ItemsControl ItemsSource="{CompiledBinding Dependencies}">
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Spacing="8"></StackPanel>
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                    </ItemsControl>
                </ScrollViewer>
            </StackPanel>
        </Border>
    </StackPanel>
</UserControl>