<Page
    x:Class="APKInstaller.Pages.SettingsPages.SettingsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:APKInstaller.Controls"
    xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:interopservices="using:System.Runtime.InteropServices"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:models="using:AdvancedSharpAdbClient.Models"
    xmlns:settingspages="using:APKInstaller.ViewModels.SettingsPages"
    xmlns:ui="using:CommunityToolkit.WinUI.UI"
    d:DataContext="{d:DesignInstance Type=settingspages:SettingsViewModel}"
    NavigationCacheMode="Enabled"
    mc:Ignorable="d">
    <Grid>
        <Grid.Resources>
            <Style TargetType="controls:SettingsGroup">
                <Setter Property="Margin" Value="0,-28,0,0" />
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <controls:TitleBar
            x:Name="TitleBar"
            x:Uid="/SettingsPage/TitleBar"
            BackRequested="TitleBar_BackRequested"
            IsBackButtonVisible="True"
            IsBackEnabled="{x:Bind Frame.CanGoBack}" />
        <ScrollViewer Grid.Row="1">
            <StackPanel Padding="16,0,16,16">
                <StackPanel.ChildrenTransitions>
                    <TransitionCollection>
                        <ReorderThemeTransition />
                    </TransitionCollection>
                </StackPanel.ChildrenTransitions>
                <controls:SettingsGroup
                    x:Name="ModifiedSettingsHeader"
                    Margin="0"
                    x:Load="{x:Bind settingspages:SettingsViewModel.IsModified}">
                    <InfoBar
                        x:Uid="/SettingsPage/ModifiedInfoBar"
                        IsClosable="False"
                        IsOpen="{Binding IsModified}"
                        Severity="Error">
                        <InfoBar.ActionButton>
                            <HyperlinkButton
                                x:Uid="/SettingsPage/LearnMoreLink"
                                NavigateUri="https://github.com/Paving-Base/APK-Installer/issues/79"
                                ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                        </InfoBar.ActionButton>
                    </InfoBar>
                </controls:SettingsGroup>
                <controls:WebXAML
                    x:Name="MessageBar"
                    x:Load="{x:Bind Provider.ShowMessages, Mode=OneWay}"
                    Loaded="WebXAML_Loaded"
                    Visibility="{Binding ShowMessages, Converter={StaticResource BoolToVisibilityConverter}}" />
                <controls:SettingsGroup x:Uid="/SettingsPage/DeviceSettingsHeader">
                    <ListView
                        x:Name="SelectDeviceBox"
                        Margin="-2,0"
                        x:FieldModifier="public"
                        ItemsSource="{Binding DeviceList, Mode=OneWay}"
                        SelectionChanged="SelectDeviceBox_SelectionChanged">
                        <ListView.ItemTemplate>
                            <DataTemplate x:DataType="models:DeviceData">
                                <ListViewItem Margin="0,1" Background="Transparent">
                                    <controls:Setting
                                        Description="{x:Bind State}"
                                        Header="{x:Bind Name}"
                                        Icon="&#xE8EA;"
                                        Style="{StaticResource ListViewItemContentSettingStyle}" />
                                </ListViewItem>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
                    <controls:SettingExpander
                        x:Uid="/SettingsPage/OnlyWSASettings"
                        Icon="&#xE975;"
                        IsExpanded="{Binding IsOnlyWSA, Converter={StaticResource BoolNegationConverter}}">
                        <controls:SettingExpander.ActionContent>
                            <ToggleSwitch IsOn="{Binding IsOnlyWSA, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                        </controls:SettingExpander.ActionContent>
                        <controls:Setting x:Uid="/SettingsPage/ConnectDevice" Style="{StaticResource DefaultSettingExpanderItemStyle}">
                            <Grid MinWidth="{StaticResource SettingCardContentMinWidth}" ColumnSpacing="8">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="40" />
                                </Grid.ColumnDefinitions>
                                <TextBox
                                    x:Name="ConnectIP"
                                    Grid.Column="0"
                                    ui:TextBoxExtensions.Regex="{StaticResource IPAddressRegexPattern}"
                                    PlaceholderText="127.0.0.1:58526" />
                                <Grid Grid.Column="1">
                                    <ProgressRing
                                        Width="24"
                                        Height="24"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Visibility="{Binding ConnectingDevice, Converter={StaticResource BoolToVisibilityConverter}}" />
                                    <Button
                                        Width="40"
                                        Height="36"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Click="Button_Click"
                                        Content="&#xE71B;"
                                        FontFamily="{StaticResource SymbolThemeFontFamily}"
                                        IsEnabled="{x:Bind ConnectIP.(ui:TextBoxExtensions.IsValid), Mode=OneWay}"
                                        Tag="Connect"
                                        Visibility="{Binding ConnectingDevice, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='true'}" />
                                </Grid>
                            </Grid>
                        </controls:Setting>
                        <controls:Setting x:Uid="/SettingsPage/PairDevice" Style="{StaticResource DefaultSettingExpanderItemStyle}">
                            <Grid MinWidth="{StaticResource SettingCardContentMinWidth}" ColumnSpacing="8">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="40" />
                                </Grid.ColumnDefinitions>
                                <TextBox
                                    x:Name="PairCode"
                                    Grid.Column="0"
                                    PlaceholderText="888888" />
                                <Grid Grid.Column="1">
                                    <ProgressRing
                                        Width="24"
                                        Height="24"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Visibility="{Binding PairingDevice, Converter={StaticResource BoolToVisibilityConverter}}" />
                                    <Button
                                        Width="40"
                                        Height="36"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Click="Button_Click"
                                        Content="&#xE8D7;"
                                        FontFamily="{StaticResource SymbolThemeFontFamily}"
                                        IsEnabled="{x:Bind ConnectIP.(ui:TextBoxExtensions.IsValid), Mode=OneWay}"
                                        Tag="Pair"
                                        Visibility="{Binding PairingDevice, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='true'}" />
                                </Grid>
                            </Grid>
                        </controls:Setting>
                        <Grid Style="{StaticResource SettingExpanderContentGridStyle}">
                            <Grid.Resources>
                                <Style BasedOn="{StaticResource CaptionTextBlockStyle}" TargetType="TextBlock">
                                    <Style.Setters>
                                        <Setter Property="TextWrapping" Value="WrapWholeWords" />
                                    </Style.Setters>
                                </Style>
                                <Style BasedOn="{StaticResource TextButtonStyle}" TargetType="HyperlinkButton">
                                    <Style.Setters>
                                        <Setter Property="FontSize" Value="{ThemeResource SettingCardDescriptionFontSize}" />
                                        <Setter Property="Padding" Value="0,0,0,0" />
                                    </Style.Setters>
                                </Style>
                            </Grid.Resources>
                            <ItemsRepeaterScrollHost>
                                <ScrollViewer
                                    Margin="0,-2,0,-8"
                                    Padding="0,0,0,8"
                                    HorizontalScrollBarVisibility="Auto"
                                    VerticalScrollBarVisibility="Disabled">
                                    <ItemsRepeater ItemsSource="{Binding ConnectHelpers}">
                                        <ItemsRepeater.Layout>
                                            <StackLayout Orientation="Horizontal" Spacing="4" />
                                        </ItemsRepeater.Layout>
                                        <ItemsRepeater.ItemTemplate>
                                            <DataTemplate x:DataType="settingspages:HyperlinkContent">
                                                <HyperlinkButton
                                                    Content="{x:Bind Content}"
                                                    NavigateUri="{x:Bind NavigateUri}"
                                                    ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                            </DataTemplate>
                                        </ItemsRepeater.ItemTemplate>
                                    </ItemsRepeater>
                                </ScrollViewer>
                            </ItemsRepeaterScrollHost>
                        </Grid>
                    </controls:SettingExpander>
                    <InfoBar
                        x:Name="ConnectInfo"
                        Title="{Binding ConnectInfoTitle}"
                        IsOpen="{Binding ConnectInfoIsOpen, Mode=TwoWay}"
                        Loaded="InfoBar_Loaded"
                        Severity="{Binding ConnectInfoSeverity}"
                        Visibility="{Binding ConnectInfoIsOpen, Converter={StaticResource BoolToVisibilityConverter}}" />
                    <controls:Setting
                        x:Uid="/SettingsPage/PairDeviceSettings"
                        Click="Button_Click"
                        Icon="&#xE836;"
                        IsClickEnabled="True"
                        Tag="PairDevice" />
                    <controls:Setting x:Uid="/SettingsPage/ScanPairedDeviceSettings" Icon="&#xE70C;">
                        <ToggleSwitch IsOn="{Binding ScanPairedDevice, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                    </controls:Setting>
                </controls:SettingsGroup>
                <controls:SettingsGroup x:Uid="/SettingsPage/DisplaySettingsHeader">
                    <controls:Setting x:Uid="/SettingsPage/ShowDialogsSettings" Icon="&#xE82F;">
                        <ToggleSwitch IsOn="{Binding ShowDialogs, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                    </controls:Setting>
                    <controls:Setting x:Uid="/SettingsPage/ShowMessagesSettings" Icon="&#xE789;">
                        <ToggleSwitch IsOn="{Binding ShowMessages, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                    </controls:Setting>
                    <controls:Setting x:Uid="/SettingsPage/ShowProgressSettings" Icon="&#xF16A;">
                        <ToggleSwitch IsOn="{Binding ShowProgress, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                    </controls:Setting>
                </controls:SettingsGroup>
                <controls:SettingsGroup x:Uid="/SettingsPage/ThemesSettingsHeader">
                    <controls:Setting x:Uid="/SettingsPage/ThemeSettings" Icon="&#xE790;">
                        <controls:Setting.Description>
                            <HyperlinkButton
                                x:Uid="/SettingsPage/WindowsColorButton"
                                Click="HyperlinkButton_Click"
                                Tag="WindowsColor" />
                        </controls:Setting.Description>
                        <ComboBox SelectedIndex="{Binding SelectedTheme, Mode=TwoWay}">
                            <ComboBoxItem x:Uid="/SettingsPage/RadioThemeDark" />
                            <ComboBoxItem x:Uid="/SettingsPage/RadioThemeLight" />
                            <ComboBoxItem x:Uid="/SettingsPage/RadioThemeDefault" />
                        </ComboBox>
                    </controls:Setting>
                    <controls:Setting x:Uid="/SettingsPage/BackdropSettings" Icon="&#xE81E;">
                        <ComboBox SelectedIndex="{Binding SelectedBackdrop, Mode=TwoWay}">
                            <x:String>Mica</x:String>
                            <x:String>MicaAlt</x:String>
                            <x:String>Acrylic</x:String>
                            <x:String>DefaultColor</x:String>
                        </ComboBox>
                    </controls:Setting>
                </controls:SettingsGroup>
                <controls:SettingsGroup x:Uid="/SettingsPage/ContentSettingsHeader">
                    <controls:Setting x:Uid="/SettingsPage/AutoGetNetAPKSettings" Icon="&#xE896;">
                        <ToggleSwitch IsOn="{Binding AutoGetNetAPK, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                    </controls:Setting>
                    <controls:Setting x:Uid="/SettingsPage/CloseAPPSettings" Icon="&#xEDAE;">
                        <ToggleSwitch IsOn="{Binding IsCloseAPP, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                    </controls:Setting>
                    <controls:Setting x:Uid="/SettingsPage/CloseADBSettings" Icon="&#xE756;">
                        <ToggleSwitch IsOn="{Binding IsCloseADB, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                    </controls:Setting>
                </controls:SettingsGroup>
                <controls:SettingsGroup x:Uid="/SettingsPage/ConfigsSettingsHeader">
                    <controls:Setting x:Uid="/SettingsPage/ADBPathSettings" Icon="&#xE8B7;">
                        <controls:Setting.Description>
                            <HyperlinkButton
                                Click="HyperlinkButton_Click"
                                Content="{Binding ADBPath}"
                                Tag="ADBPath" />
                        </controls:Setting.Description>
                        <Button
                            x:Uid="/SettingsPage/Change"
                            Click="Button_Click"
                            Tag="ADBPath" />
                    </controls:Setting>
                    <controls:Setting x:Uid="/SettingsPage/ResetSettings" Icon="&#xE777;">
                        <Button Name="Reset" x:Uid="/SettingsPage/ResetSettingsButton">
                            <Button.Flyout>
                                <Flyout>
                                    <StackPanel>
                                        <TextBlock
                                            x:Uid="/SettingsPage/ResetSettingsTitle"
                                            Margin="0,0,0,12"
                                            Style="{ThemeResource BaseTextBlockStyle}" />
                                        <Button
                                            x:Uid="/SettingsPage/ResetSettingsConfirm"
                                            Click="Button_Click"
                                            Tag="Reset" />
                                    </StackPanel>
                                </Flyout>
                            </Button.Flyout>
                        </Button>
                    </controls:Setting>
                    <controls:SettingExpander x:Uid="/SettingsPage/FrameworkSettings" Icon="&#xE950;">
                        <Grid Style="{StaticResource SettingExpanderContentGridStyle}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <TextBlock
                                x:Uid="/SettingsPage/ADBVersionTextBlock"
                                Grid.Row="0"
                                Grid.Column="0"
                                Padding="0,0,0,8"
                                Foreground="{ThemeResource CardPrimaryForegroundBrush}" />
                            <TextBlock
                                Grid.Row="0"
                                Grid.Column="1"
                                Padding="32,0,0,8"
                                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                                Text="{Binding ADBVersion}"
                                TextWrapping="WrapWholeWords" />

                            <TextBlock
                                x:Uid="/SettingsPage/FrameworkTextBlock"
                                Grid.Row="1"
                                Grid.Column="0"
                                Padding="0,0,0,8"
                                Foreground="{ThemeResource CardPrimaryForegroundBrush}" />
                            <TextBlock
                                Grid.Row="1"
                                Grid.Column="1"
                                Padding="32,0,0,8"
                                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                                Text="{x:Bind interopservices:RuntimeInformation.FrameworkDescription}"
                                TextWrapping="WrapWholeWords" />

                            <TextBlock
                                Grid.Row="2"
                                Grid.Column="0"
                                Padding="0,0,0,8"
                                Foreground="{ThemeResource CardPrimaryForegroundBrush}"
                                Text="CS/WinRT" />
                            <TextBlock
                                Grid.Row="2"
                                Grid.Column="1"
                                Padding="32,0,0,8"
                                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                                Text="{Binding WinRTVersion}"
                                TextWrapping="WrapWholeWords" />

                            <TextBlock
                                Grid.Row="3"
                                Grid.Column="0"
                                Padding="0,0,0,8"
                                Foreground="{ThemeResource CardPrimaryForegroundBrush}"
                                Text="Windows SDK" />
                            <TextBlock
                                Grid.Row="3"
                                Grid.Column="1"
                                Padding="32,0,0,8"
                                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                                Text="{Binding SDKVersion}"
                                TextWrapping="WrapWholeWords" />

                            <TextBlock
                                Grid.Row="4"
                                Grid.Column="0"
                                Padding="0,0,0,8"
                                Foreground="{ThemeResource CardPrimaryForegroundBrush}"
                                Text="Windows App SDK" />
                            <TextBlock
                                Grid.Row="4"
                                Grid.Column="1"
                                Padding="32,0,0,8"
                                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                                Text="{Binding WASVersion}"
                                TextWrapping="WrapWholeWords" />

                            <TextBlock
                                x:Uid="/SettingsPage/OSPlatformTextBlock"
                                Grid.Row="5"
                                Grid.Column="0"
                                Padding="0,0,0,8"
                                Foreground="{ThemeResource CardPrimaryForegroundBrush}" />
                            <TextBlock
                                Grid.Row="5"
                                Grid.Column="1"
                                Padding="32,0,0,8"
                                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                                Text="{x:Bind interopservices:RuntimeInformation.OSDescription}"
                                TextWrapping="WrapWholeWords" />

                            <TextBlock
                                x:Uid="/SettingsPage/OSArchitectureTextBlock"
                                Grid.Row="6"
                                Grid.Column="0"
                                Padding="0,0,0,8"
                                Foreground="{ThemeResource CardPrimaryForegroundBrush}" />
                            <TextBlock
                                Grid.Row="6"
                                Grid.Column="1"
                                Padding="32,0,0,8"
                                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                                Text="{x:Bind interopservices:RuntimeInformation.OSArchitecture}"
                                TextWrapping="WrapWholeWords" />
                        </Grid>
                    </controls:SettingExpander>
                </controls:SettingsGroup>
                <controls:SettingsGroup x:Uid="/SettingsPage/AboutSettingsHeader">
                    <controls:SettingExpander Header="{Binding VersionTextBlockText}" Icon="&#xE117;">
                        <controls:SettingExpander.Description>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Style="{StaticResource SecondaryTextStyle}" TextWrapping="WrapWholeWords">
                                    <Run x:Uid="/SettingsPage/LastChecked" />
                                    <Run Text="{Binding UpdateDate}" />
                                </TextBlock>
                                <ScrollViewer
                                    Margin="0,0,0,-8"
                                    Padding="0,2,0,8"
                                    HorizontalScrollBarVisibility="Auto"
                                    VerticalScrollBarVisibility="Disabled">
                                    <StackPanel Orientation="Horizontal" Spacing="4">
                                        <HyperlinkButton
                                            x:Uid="/SettingsPage/FeedbackLink"
                                            NavigateUri="https://github.com/Paving-Base/APK-Installer/issues"
                                            ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                        <HyperlinkButton
                                            x:Uid="/SettingsPage/LogFolderLink"
                                            Click="HyperlinkButton_Click"
                                            Tag="LogFolder" />
                                        <HyperlinkButton
                                            x:Uid="/SettingsPage/TranslateLink"
                                            NavigateUri="https://crowdin.com/project/APKInstaller"
                                            ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                        <HyperlinkButton
                                            x:Uid="/SettingsPage/ReleaseNotes"
                                            NavigateUri="https://github.com/Paving-Base/APK-Installer/releases/latest"
                                            ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                        <HyperlinkButton
                                            x:Uid="/SettingsPage/EULA"
                                            NavigateUri="https://github.com/Paving-Base/APK-Installer/blob/main/Privacy.md"
                                            ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                    </StackPanel>
                                </ScrollViewer>
                            </StackPanel>
                        </controls:SettingExpander.Description>
                        <controls:SettingExpander.ActionContent>
                            <controls:StackPanel
                                VerticalAlignment="Center"
                                Orientation="Horizontal"
                                Spacing="18">
                                <ProgressRing
                                    Width="24"
                                    Height="24"
                                    IsActive="{Binding CheckingUpdate}"
                                    Visibility="{Binding CheckingUpdate, Converter={StaticResource BoolToVisibilityConverter}}" />
                                <TextBlock
                                    x:Uid="/SettingsPage/CheckingUpdates"
                                    VerticalAlignment="Center"
                                    FontWeight="SemiBold"
                                    Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                                    Visibility="{Binding CheckingUpdate, Converter={StaticResource BoolToVisibilityConverter}}" />
                                <Button
                                    x:Uid="/SettingsPage/CheckUpdates"
                                    HorizontalAlignment="Right"
                                    Click="Button_Click"
                                    Tag="CheckUpdate"
                                    Visibility="{Binding CheckingUpdate, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='true'}" />
                            </controls:StackPanel>
                        </controls:SettingExpander.ActionContent>
                        <Grid Style="{StaticResource SettingExpanderContentGridStyle}">
                            <cwuc:MarkdownTextBlock
                                HorizontalAlignment="Left"
                                Background="Transparent"
                                LinkClicked="MarkdownText_LinkClicked"
                                Text="{Binding AboutTextBlockText}" />
                        </Grid>
                    </controls:SettingExpander>
                    <InfoBar
                        x:Name="UpdateState"
                        Title="{Binding UpdateStateTitle}"
                        IsClosable="True"
                        IsOpen="{Binding UpdateStateIsOpen, Mode=TwoWay}"
                        Loaded="InfoBar_Loaded"
                        Message="{Binding UpdateStateMessage}"
                        Severity="{Binding UpdateStateSeverity}"
                        Visibility="{Binding UpdateStateIsOpen, Converter={StaticResource BoolToVisibilityConverter}}">
                        <InfoBar.ActionButton>
                            <Button
                                x:Name="GotoUpdate"
                                x:Uid="/SettingsPage/GoToUpdate"
                                HorizontalAlignment="Right"
                                Click="GotoUpdate_Click"
                                Tag="{Binding GotoUpdateTag}"
                                Visibility="{Binding GotoUpdateVisibility}" />
                        </InfoBar.ActionButton>
                    </InfoBar>
                    <controls:Setting x:Uid="/SettingsPage/ContactMeSettings" Icon="&#xE779;">
                        <controls:Setting.Description>
                            <StackPanel Orientation="Vertical">
                                <TextBlock
                                    x:Uid="/SettingsPage/ContactMeTextBlock"
                                    Style="{StaticResource SecondaryTextStyle}"
                                    TextWrapping="WrapWholeWords" />
                                <ScrollViewer
                                    Margin="0,0,0,-8"
                                    Padding="0,2,0,8"
                                    HorizontalScrollBarVisibility="Auto"
                                    VerticalScrollBarVisibility="Disabled">
                                    <StackPanel Orientation="Horizontal" Spacing="4">
                                        <HyperlinkButton
                                            Content="Github"
                                            NavigateUri="https://github.com/wherewhere"
                                            ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                        <HyperlinkButton
                                            Content="Coolapk"
                                            NavigateUri="http://www.coolapk.com/u/536381"
                                            ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                        <HyperlinkButton
                                            Content="Twitter"
                                            NavigateUri="https://twitter.com/wherewhere7"
                                            ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                        <HyperlinkButton
                                            Content="Bilibili"
                                            NavigateUri="https://space.bilibili.com/266112738"
                                            ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                    </StackPanel>
                                </ScrollViewer>
                            </StackPanel>
                        </controls:Setting.Description>
                        <Button
                            x:Uid="/SettingsPage/Group"
                            Click="Button_Click"
                            Tag="Group" />
                    </controls:Setting>
                    <controls:Setting x:Uid="/SettingsPage/DonateSettings" Icon="&#xEB51;">
                        <controls:Setting.Description>
                            <StackPanel Orientation="Vertical">
                                <TextBlock
                                    x:Uid="/SettingsPage/DonateTextBlock"
                                    Style="{StaticResource SecondaryTextStyle}"
                                    TextWrapping="WrapWholeWords" />
                                <ScrollViewer
                                    Margin="0,0,0,-8"
                                    Padding="0,2,0,8"
                                    HorizontalScrollBarVisibility="Auto"
                                    VerticalScrollBarVisibility="Disabled">
                                    <StackPanel Orientation="Horizontal" Spacing="4">
                                        <HyperlinkButton
                                            Content="爱发电"
                                            NavigateUri="https://ifdian.net/@wherewhere"
                                            ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                        <HyperlinkButton
                                            Content="Patreon"
                                            NavigateUri="https://patreon.com/wherewhere"
                                            ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
                                    </StackPanel>
                                </ScrollViewer>
                            </StackPanel>
                        </controls:Setting.Description>
                        <Button
                            x:Uid="/SettingsPage/Rate"
                            Click="Button_Click"
                            Tag="Rate" />
                    </controls:Setting>
                </controls:SettingsGroup>
                <controls:SettingsGroup x:Uid="/SettingsPage/OthersSettingsHeader">
                    <controls:Setting
                        x:Name="GoToTestPage"
                        x:Uid="/SettingsPage/GoToTestPage"
                        Click="Button_Click"
                        Icon="&#xEC7A;"
                        IsClickEnabled="True"
                        Tag="TestPage" />
                </controls:SettingsGroup>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</Page>
