<controls1:EnhancedPage
    x:Class="Pixeval.Pages.Misc.AboutPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:CommunityToolkit.WinUI.Controls"
    xmlns:controls1="using:Pixeval.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:fluent="using:FluentIcons.WinUI"
    xmlns:labs="using:CommunityToolkit.Labs.WinUI.MarkdownTextBlock"
    xmlns:local="using:Pixeval.Pages.Misc"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <controls:DockPanel VerticalSpacing="10">
        <TextBlock
            x:Uid="/AboutPage/TitleTextBlock"
            Margin="20,40,20,20"
            controls:DockPanel.Dock="Top"
            Style="{StaticResource TitleTextBlockStyle}" />
        <ScrollView>
            <StackPanel Margin="20,0,20,20" Spacing="20">
                <StackPanel Spacing="10">
                    <TextBlock x:Uid="/AboutPage/SpecialThanksSubtitleTextBlock" Style="{StaticResource SubtitleTextBlockStyle}" />
                    <TextBlock
                        x:Uid="/AboutPage/SpecialThanksContentTextBlock"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        TextWrapping="Wrap" />
                    <controls:UniformGrid
                        x:Name="UniformGrid"
                        ColumnSpacing="10"
                        RowSpacing="10" />
                    <!-- 由于UniformGridLayout有崩溃Bug，暂时使用 UniformGrid 代替
                    <ItemsRepeater ItemsSource="{x:Bind _supporters}">
                        <ItemsRepeater.Layout>
                            <UniformGridLayout
                                ItemsStretch="Fill"
                                MinColumnSpacing="10"
                                MinItemHeight="160"
                                MinItemWidth="140"
                                MinRowSpacing="10" />
                        </ItemsRepeater.Layout>
                        <ItemsRepeater.ItemTemplate>
                            <DataTemplate x:DataType="local:Supporter">
                                <controls1:PersonView
                                    PersonName="{x:Bind AtName}"
                                    PersonNickname="{x:Bind Nickname}"
                                    PersonPicture="{x:Bind ProfileImage}"
                                    PersonProfileNavigateUri="{x:Bind ProfileUri}" />
                            </DataTemplate>
                        </ItemsRepeater.ItemTemplate>
                    </ItemsRepeater>-->
                </StackPanel>
                <StackPanel>
                    <TextBlock x:Uid="/AboutPage/DependenciesSubtitleTextBlock" Style="{StaticResource SubtitleTextBlockStyle}" />
                    <TextBlock
                        x:Uid="/AboutPage/DependenciesContentTextBlock"
                        Margin="0,10"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        TextWrapping="Wrap" />
                    <ItemsRepeater ItemsSource="{x:Bind local:DependencyViewModel.DependencyViewModels}">
                        <ItemsRepeater.Layout>
                            <StackLayout Orientation="Vertical" />
                        </ItemsRepeater.Layout>
                        <ItemsRepeater.ItemTemplate>
                            <DataTemplate x:DataType="local:DependencyViewModel">
                                <controls:SettingsExpander
                                    Description="{x:Bind Author}"
                                    Header="{x:Bind Name}"
                                    HeaderIcon="{fluent:SymbolIcon Symbol=box}">
                                    <controls:SettingsExpander.Content>
                                        <Button
                                            Width="40"
                                            Height="35"
                                            HorizontalContentAlignment="Center"
                                            VerticalContentAlignment="Center"
                                            Background="Transparent"
                                            BorderThickness="0"
                                            Click="LaunchUri"
                                            Content="{fluent:SymbolIcon Symbol=Open,
                                                                        FontSize=14}"
                                            Tag="{x:Bind Url}" />
                                    </controls:SettingsExpander.Content>
                                    <controls:SettingsExpander.Items>
                                        <controls:SettingsCard HorizontalContentAlignment="Left" ContentAlignment="Vertical">
                                            <labs:MarkdownTextBlock Margin="5" Text="{x:Bind License}">
                                                <labs:MarkdownTextBlock.Config>
                                                    <labs:MarkdownConfig />
                                                </labs:MarkdownTextBlock.Config>
                                            </labs:MarkdownTextBlock>
                                        </controls:SettingsCard>
                                    </controls:SettingsExpander.Items>
                                </controls:SettingsExpander>
                            </DataTemplate>
                        </ItemsRepeater.ItemTemplate>
                    </ItemsRepeater>
                </StackPanel>
                <StackPanel Spacing="10">
                    <TextBlock x:Uid="/AboutPage/SupportMeSubtitleTextBlock" Style="{StaticResource SubtitleTextBlockStyle}" />
                    <TextBlock Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="Wrap">
                        <Run x:Uid="/AboutPage/SupportMeContentPartI" />
                        <Hyperlink NavigateUri="https://afdian.net/@dylech30th">
                            <Hyperlink.Inlines>
                                <Run x:Uid="/AboutPage/SupportMeHyperlinkContent" />
                            </Hyperlink.Inlines>
                        </Hyperlink>
                        <Run x:Uid="/AboutPage/SupportMeContentPartII" />
                    </TextBlock>
                </StackPanel>
                <StackPanel Spacing="10">
                    <TextBlock x:Uid="/AboutPage/OpenSourceLicenseSubtitleTextBlock" Style="{StaticResource SubtitleTextBlockStyle}" />
                    <TextBlock Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="Wrap">
                        <Run x:Uid="/AboutPage/OpenSourceLicenseContentPartI" />
                        <Hyperlink NavigateUri="https://www.gnu.org/licenses/gpl-3.0.en.html">
                            <Hyperlink.Inlines>
                                <Run x:Uid="/AboutPage/OpenSourceLicenseHyperlinkContent" />
                            </Hyperlink.Inlines>
                        </Hyperlink>
                        <Run x:Uid="/AboutPage/OpenSourceLicenseContentPartII" />
                    </TextBlock>
                    <labs:MarkdownTextBlock x:Name="LicenseTextBlock" Text="">
                        <labs:MarkdownTextBlock.Config>
                            <labs:MarkdownConfig />
                        </labs:MarkdownTextBlock.Config>
                    </labs:MarkdownTextBlock>
                </StackPanel>
            </StackPanel>
        </ScrollView>
    </controls:DockPanel>
</controls1:EnhancedPage>
