<UserControl x:Class="UniGetUI.Avalonia.Views.Pages.SettingsPages.Internet"
             xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:automation="clr-namespace:Avalonia.Automation;assembly=Avalonia.Controls"
             xmlns:vm="using:UniGetUI.Avalonia.ViewModels.Pages.SettingsPages"
             xmlns:settings="using:UniGetUI.Avalonia.Views.Controls.Settings"
             xmlns:t="using:UniGetUI.Avalonia.MarkupExtensions"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:DataType="vm:InternetViewModel">
    <ScrollViewer HorizontalScrollBarVisibility="Disabled">
        <StackPanel Orientation="Vertical">

            <settings:TranslatedTextBlock Text="Proxy settings"
                                          FontSize="14"
                                          FontWeight="SemiBold"
                                          Margin="44,32,4,8"
                                          automation:AutomationProperties.HeadingLevel="2"/>

            <settings:CheckboxCard x:Name="ProxyCard"
                                   SettingName="EnableProxy"
                                   Text="{t:Translate Connect the internet using a custom proxy}"
                                   Description="{t:Translate Text='Please note that not all package managers may fully support this feature'}"
                                   StateChangedCommand="{Binding RefreshProxyEnabledCommand}"
                                   CornerRadius="8,8,0,0"/>

            <settings:TextboxCard x:Name="ProxyURLCard"
                                  SettingName="ProxyURL"
                                  Text="{t:Translate Proxy URL}"
                                  Placeholder="{t:Translate Enter proxy URL here}"
                                  ValueChangedCommand="{Binding ApplyProxyCommand}"
                                  CornerRadius="0,0,8,8"
                                  BorderThickness="1,0,1,1"
                                  IsEnabled="{Binding IsProxyEnabled}"/>

            <Border Height="16"/>

            <settings:CheckboxCard x:Name="ProxyAuthCard"
                                   SettingName="EnableProxyAuth"
                                   Text="{t:Translate Authenticate to the proxy with a user and a password}"
                                   Description="{t:Translate Text='Please note that not all package managers may fully support this feature'}"
                                   StateChangedCommand="{Binding RefreshProxyAuthEnabledCommand}"
                                   CornerRadius="8,8,0,0"
                                   IsEnabled="{Binding IsProxyEnabled}"/>

            <ContentControl x:Name="CredentialsHolder"
                            IsEnabled="{Binding IsProxyAuthEnabled}"/>

            <Border Height="16"/>

            <ContentControl x:Name="ProxyCompatTableHolder"/>

            <settings:TranslatedTextBlock Text="Other settings"
                                          FontSize="14"
                                          FontWeight="SemiBold"
                                          Margin="44,32,4,8"
                                          automation:AutomationProperties.HeadingLevel="2"/>

            <settings:CheckboxCard x:Name="InternetOtherCard"
                                   SettingName="DisableWaitForInternetConnection"
                                   Text="{t:Translate Wait for the device to be connected to the internet before attempting to do tasks that require internet connectivity.}"
                                   StateChangedCommand="{Binding ShowRestartRequiredCommand}"
                                   CornerRadius="8"/>
        </StackPanel>
    </ScrollViewer>

</UserControl>
