<local:SettingSectionControl
    x:Class="Bili.App.Controls.RoamingSettingSection"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ico="using:Richasy.FluentIcon.Uwp"
    xmlns:labs="using:CommunityToolkit.Labs.WinUI"
    xmlns:loc="using:Bili.App.Resources.Extension"
    xmlns:local="using:Bili.App.Controls"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignHeight="300"
    d:DesignWidth="400"
    mc:Ignorable="d">

    <labs:SettingsExpander Description="{loc:Locale Name=ProxySettingDescription}" Header="{loc:Locale Name=ProxySetting}">
        <labs:SettingsExpander.HeaderIcon>
            <ico:RegularFluentIcon Symbol="GlobeVideo20" />
        </labs:SettingsExpander.HeaderIcon>
        <ToggleSwitch IsOn="{x:Bind ViewModel.IsOpenRoaming, Mode=TwoWay}" />
        <labs:SettingsExpander.Items>
            <labs:SettingsCard>
                <labs:SettingsCard.Header>
                    <StackPanel>
                        <TextBlock HorizontalAlignment="Left" Text="{loc:Locale Name=GlobeProxy}" />
                        <TextBlock
                            Style="{StaticResource CaptionTextBlockStyle}"
                            HorizontalAlignment="Left"
                            Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                            Text="{loc:Locale Name=GlobeProxyDescription}"
                            TextTrimming="CharacterEllipsis" />
                    </StackPanel>
                </labs:SettingsCard.Header>
                <ToggleSwitch IsOn="{x:Bind ViewModel.IsGlobeProxy, Mode=TwoWay}" />
            </labs:SettingsCard>
            <labs:SettingsCard>
                <labs:SettingsCard.Header>
                    <StackPanel>
                        <TextBlock HorizontalAlignment="Left" Text="{loc:Locale Name=ProxyViewAddress}" />
                        <TextBlock FontSize="12">
                            <Hyperlink NavigateUri="https://github.com/Richasy/Bili.Uwp/wiki/%E7%95%AA%E5%89%A7%E4%BB%A3%E7%90%86#%E8%AF%A6%E6%83%85%E4%BB%A3%E7%90%86">
                                <Run Text="{loc:Locale Name=FunctionIntroduce}" />
                            </Hyperlink>
                        </TextBlock>
                    </StackPanel>
                </labs:SettingsCard.Header>
                <AutoSuggestBox
                    MinWidth="240"
                    MaxWidth="300"
                    VerticalAlignment="Center"
                    PlaceholderText="{loc:Locale Name=EnterToEffect}"
                    QueryIcon="Save"
                    QuerySubmitted="OnViewAddressBoxSubmitted"
                    Text="{x:Bind ViewModel.RoamingViewAddress, Mode=OneWay}" />
            </labs:SettingsCard>
            <labs:SettingsCard>
                <labs:SettingsCard.Header>
                    <StackPanel>
                        <TextBlock HorizontalAlignment="Left" Text="{loc:Locale Name=ProxyVideoAddress}" />
                        <TextBlock FontSize="12">
                            <Hyperlink NavigateUri="https://github.com/Richasy/Bili.Uwp/wiki/%E7%95%AA%E5%89%A7%E4%BB%A3%E7%90%86#%E6%92%AD%E6%94%BE%E4%BB%A3%E7%90%86">
                                <Run Text="{loc:Locale Name=FunctionIntroduce}" />
                            </Hyperlink>
                        </TextBlock>
                    </StackPanel>
                </labs:SettingsCard.Header>
                <AutoSuggestBox
                    MinWidth="240"
                    MaxWidth="300"
                    VerticalAlignment="Center"
                    PlaceholderText="{loc:Locale Name=EnterToEffect}"
                    QueryIcon="Save"
                    QuerySubmitted="OnVideoAddressBoxSubmitted"
                    Text="{x:Bind ViewModel.RoamingVideoAddress, Mode=OneWay}" />
            </labs:SettingsCard>
            <labs:SettingsCard>
                <labs:SettingsCard.Header>
                    <StackPanel>
                        <TextBlock HorizontalAlignment="Left" Text="{loc:Locale Name=ProxySearchAddress}" />
                        <TextBlock FontSize="12">
                            <Hyperlink NavigateUri="https://github.com/Richasy/Bili.Uwp/wiki/%E7%95%AA%E5%89%A7%E4%BB%A3%E7%90%86#%E6%90%9C%E7%B4%A2%E4%BB%A3%E7%90%86">
                                <Run Text="{loc:Locale Name=FunctionIntroduce}" />
                            </Hyperlink>
                        </TextBlock>
                    </StackPanel>
                </labs:SettingsCard.Header>
                <AutoSuggestBox
                    MinWidth="240"
                    MaxWidth="300"
                    VerticalAlignment="Center"
                    PlaceholderText="{loc:Locale Name=EnterToEffect}"
                    QueryIcon="Save"
                    QuerySubmitted="OnSearchAddressBoxSubmitted"
                    Text="{x:Bind ViewModel.RoamingSearchAddress, Mode=OneWay}" />
            </labs:SettingsCard>
        </labs:SettingsExpander.Items>
    </labs:SettingsExpander>
</local:SettingSectionControl>
