<ContentDialog
    x:Class="Nickvision.Parabolic.WinUI.Controls.AboutDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Nickvision.Parabolic.WinUI.Controls"
    xmlns:nickvision="using:Nickvision.Desktop.WinUI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" Style="{StaticResource DefaultContentDialogStyle}"
    Loaded="Dialog_Loaded">

    <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible">
        <Grid RowSpacing="6">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <SelectorBar Grid.Row="0" SelectionChanged="SelectorBar_SelectionChanged">
                <SelectorBarItem x:Name="SelectorGeneral" IsSelected="True">
                    <SelectorBarItem.Icon>
                        <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE946;"/>
                    </SelectorBarItem.Icon>
                </SelectorBarItem>

                <SelectorBarItem x:Name="SelectorChangelog">
                    <SelectorBarItem.Icon>
                        <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8FD;"/>
                    </SelectorBarItem.Icon>
                </SelectorBarItem>

                <SelectorBarItem x:Name="SelectorDebugging">
                    <SelectorBarItem.Icon>
                        <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE756;"/>
                    </SelectorBarItem.Icon>
                </SelectorBarItem>

                <SelectorBarItem x:Name="SelectorCredits">
                    <SelectorBarItem.Icon>
                        <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE716;"/>
                    </SelectorBarItem.Icon>
                </SelectorBarItem>
            </SelectorBar>

            <nickvision:ViewStack x:Name="ViewStack" Grid.Row="1" MinWidth="400" MinHeight="320">
                <nickvision:ViewStack.Pages>
                    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="12">
                        <ImageIcon HorizontalAlignment="Center" Height="96" Source="/Assets/org.nickvision.tubeconverter.ico"/>

                        <TextBlock x:Name="LblAppName" HorizontalAlignment="Center" Style="{ThemeResource SubtitleTextBlockStyle}"/>

                        <TextBlock x:Name="LblAppDescription" HorizontalAlignment="Center"/>

                        <TextBlock x:Name="LblAppVersion" HorizontalAlignment="Center" IsTextSelectionEnabled="True"/>

                        <TextBlock x:Name="LblAppCopyright" HorizontalAlignment="Center" Foreground="Gray"/>
                    </StackPanel>

                    <TextBlock x:Name="LblChangelog" Margin="6,0,6,0" TextWrapping="Wrap" IsTextSelectionEnabled="True"/>

                    <Grid RowSpacing="12">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <Button Grid.Row="0" HorizontalAlignment="Stretch" Click="CopyDebugInformation">
                            <StackPanel Orientation="Horizontal" Spacing="6">
                                <FontIcon x:Name="IconCopyDebugInformation" FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8C8;"/>

                                <TextBlock x:Name="LblCopyDebugInformation"/>
                            </StackPanel>
                        </Button>

                        <TextBlock x:Name="LblDebugInformation" Grid.Row="1" TextWrapping="Wrap" IsTextSelectionEnabled="True"/>
                    </Grid>

                    <TextBlock x:Name="LblCredits" Margin="6,0,6,0" TextWrapping="Wrap" IsTextSelectionEnabled="True"/>
                </nickvision:ViewStack.Pages>
            </nickvision:ViewStack>
        </Grid>
    </ScrollViewer>
</ContentDialog>