<reactiveui:ReactiveWindow
    x:Class="v2rayN.Views.DNSSettingWindow"
    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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:reactiveui="http://reactiveui.net"
    xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
    xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
    Title="{x:Static resx:ResUI.menuDNSSetting}"
    Width="1000"
    Height="700"
    x:TypeArguments="vms:DNSSettingViewModel"
    ShowInTaskbar="False"
    Style="{StaticResource WindowGlobal}"
    WindowStartupLocation="CenterScreen"
    mc:Ignorable="d">
    <DockPanel Margin="{StaticResource Margin8}">
        <StackPanel
            Margin="{StaticResource Margin4}"
            HorizontalAlignment="Center"
            DockPanel.Dock="Bottom"
            Orientation="Horizontal">
            <Button
                x:Name="btnSave"
                Width="100"
                Content="{x:Static resx:ResUI.TbConfirm}"
                Cursor="Hand"
                IsDefault="True"
                Style="{StaticResource DefButton}" />
            <Button
                x:Name="btnCancel"
                Width="100"
                Margin="{StaticResource MarginLeftRight8}"
                Content="{x:Static resx:ResUI.TbCancel}"
                Cursor="Hand"
                IsCancel="true"
                Style="{StaticResource DefButton}" />
        </StackPanel>

        <TabControl HorizontalContentAlignment="Left">

            <TabItem Header="{x:Static resx:ResUI.TbSettingsCoreDns}">
                <DockPanel Margin="{StaticResource Margin8}">
                    <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
                        <TextBlock
                            Margin="{StaticResource Margin8}"
                            VerticalAlignment="Center"
                            Style="{StaticResource ToolbarTextBlock}"
                            Text="{x:Static resx:ResUI.TbSettingsRemoteDNS}" />
                        <TextBlock
                            Margin="{StaticResource Margin8}"
                            VerticalAlignment="Center"
                            Style="{StaticResource ToolbarTextBlock}">
                            <Hyperlink Click="linkDnsObjectDoc_Click">
                                <TextBlock Text="{x:Static resx:ResUI.TbDnsObjectDoc}" />
                                <materialDesign:PackIcon Kind="Link" />
                            </Hyperlink>
                        </TextBlock>
                        <Button
                            x:Name="btnImportDefConfig4V2ray"
                            Margin="{StaticResource Margin8}"
                            Content="{x:Static resx:ResUI.TbSettingDnsImportDefConfig}"
                            Cursor="Hand"
                            Style="{StaticResource DefButton}" />
                    </StackPanel>

                    <WrapPanel DockPanel.Dock="Bottom" Orientation="Horizontal">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock
                                Margin="{StaticResource Margin8}"
                                VerticalAlignment="Center"
                                Style="{StaticResource ToolbarTextBlock}"
                                Text="{x:Static resx:ResUI.TbSettingsUseSystemHosts}" />
                            <ToggleButton
                                x:Name="togUseSystemHosts"
                                Margin="{StaticResource Margin8}"
                                HorizontalAlignment="Left" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal">
                            <TextBlock
                                Margin="{StaticResource Margin8}"
                                VerticalAlignment="Center"
                                Style="{StaticResource ToolbarTextBlock}"
                                Text="{x:Static resx:ResUI.TbSettingsDomainStrategy4Freedom}" />
                            <ComboBox
                                x:Name="cmbdomainStrategy4Freedom"
                                Width="150"
                                Margin="{StaticResource Margin8}"
                                Style="{StaticResource DefComboBox}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal">
                            <TextBlock
                                Margin="{StaticResource Margin8}"
                                VerticalAlignment="Center"
                                Style="{StaticResource ToolbarTextBlock}"
                                Text="{x:Static resx:ResUI.TbSettingsDomainDNSAddress}" />
                            <ComboBox
                                x:Name="cmbdomainDNSAddress"
                                Width="150"
                                Margin="{StaticResource Margin8}"
                                IsEditable="True"
                                Style="{StaticResource DefComboBox}" />
                        </StackPanel>
                    </WrapPanel>

                    <TextBox
                        x:Name="txtnormalDNS"
                        Margin="{StaticResource Margin8}"
                        VerticalAlignment="Stretch"
                        materialDesign:HintAssist.Hint="HTTP/SOCKS"
                        AcceptsReturn="True"
                        BorderThickness="1"
                        Style="{StaticResource MaterialDesignOutlinedTextBox}"
                        TextWrapping="Wrap"
                        VerticalScrollBarVisibility="Auto" />
                </DockPanel>
            </TabItem>

            <TabItem Header="{x:Static resx:ResUI.TbSettingsCoreDnsSingbox}">
                <DockPanel Margin="{StaticResource Margin8}">
                    <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
                        <TextBlock
                            Margin="{StaticResource Margin8}"
                            VerticalAlignment="Center"
                            Style="{StaticResource ToolbarTextBlock}">
                            <Hyperlink Click="linkDnsSingboxObjectDoc_Click">
                                <TextBlock Text="{x:Static resx:ResUI.TbDnsSingboxObjectDoc}" />
                                <materialDesign:PackIcon Kind="Link" />
                            </Hyperlink>
                        </TextBlock>
                        <Button
                            x:Name="btnImportDefConfig4Singbox"
                            Margin="{StaticResource Margin8}"
                            Content="{x:Static resx:ResUI.TbSettingDnsImportDefConfig}"
                            Cursor="Hand"
                            Style="{StaticResource DefButton}" />
                    </StackPanel>

                    <WrapPanel DockPanel.Dock="Bottom" Orientation="Horizontal">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock
                                Margin="{StaticResource Margin8}"
                                VerticalAlignment="Center"
                                Style="{StaticResource ToolbarTextBlock}"
                                Text="{x:Static resx:ResUI.TbSettingsDomainStrategy4Out}" />
                            <ComboBox
                                x:Name="cmbdomainStrategy4Out"
                                Width="150"
                                Margin="{StaticResource Margin8}"
                                Style="{StaticResource DefComboBox}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal">
                            <TextBlock
                                Margin="{StaticResource Margin8}"
                                VerticalAlignment="Center"
                                Style="{StaticResource ToolbarTextBlock}"
                                Text="{x:Static resx:ResUI.TbSettingsDomainDNSAddress}" />
                            <ComboBox
                                x:Name="cmbdomainDNSAddress2"
                                Width="150"
                                Margin="{StaticResource Margin8}"
                                IsEditable="True"
                                Style="{StaticResource DefComboBox}" />
                        </StackPanel>
                    </WrapPanel>

                    <Grid Margin="{StaticResource Margin8}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*" />
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition Width="1*" />
                        </Grid.ColumnDefinitions>

                        <TextBox
                            x:Name="txtnormalDNS2"
                            Grid.Column="0"
                            VerticalAlignment="Stretch"
                            materialDesign:HintAssist.Hint="HTTP/SOCKS"
                            AcceptsReturn="True"
                            BorderThickness="1"
                            Style="{StaticResource MaterialDesignOutlinedTextBox}"
                            TextWrapping="Wrap"
                            VerticalScrollBarVisibility="Auto" />

                        <GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" />

                        <TextBox
                            x:Name="txttunDNS2"
                            Grid.Column="2"
                            VerticalAlignment="Stretch"
                            materialDesign:HintAssist.Hint="{x:Static resx:ResUI.TbSettingsTunMode}"
                            AcceptsReturn="True"
                            BorderThickness="1"
                            Style="{StaticResource MaterialDesignOutlinedTextBox}"
                            TextWrapping="Wrap"
                            VerticalScrollBarVisibility="Auto" />
                    </Grid>
                </DockPanel>
            </TabItem>
        </TabControl>
    </DockPanel>
</reactiveui:ReactiveWindow>