<base:WindowBase
    x:Class="v2rayN.Views.FullConfigTemplateWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:base="clr-namespace:v2rayN.Base"
    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.menuFullConfigTemplate}"
    Width="1000"
    Height="700"
    x:TypeArguments="vms:FullConfigTemplateViewModel"
    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}"
                IsDefault="True"
                Style="{StaticResource DefButton}" />
            <Button
                x:Name="btnCancel"
                Width="100"
                Margin="{StaticResource MarginLeftRight8}"
                Content="{x:Static resx:ResUI.TbCancel}"
                IsCancel="true"
                Style="{StaticResource DefButton}" />
        </StackPanel>

        <TabControl HorizontalContentAlignment="Left">
            <TabItem HorizontalAlignment="Left" Header="{x:Static resx:ResUI.TbRayFullConfigTemplate}">
                <DockPanel Margin="{StaticResource Margin8}">
                    <Grid DockPanel.Dock="Top">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <TextBlock
                            Grid.Row="0"
                            Margin="{StaticResource Margin8}"
                            VerticalAlignment="Center"
                            Style="{StaticResource ToolbarTextBlock}"
                            Text="{x:Static resx:ResUI.TbFullConfigTemplateDesc}"
                            TextWrapping="Wrap" />

                        <TextBlock
                            Grid.Row="1"
                            Margin="{StaticResource Margin8}"
                            VerticalAlignment="Center"
                            Style="{StaticResource ToolbarTextBlock}">
                            <Hyperlink Click="linkFullConfigTemplateDoc_Click">
                                <TextBlock Text="{x:Static resx:ResUI.TbRayFullConfigTemplateDesc}" />
                                <materialDesign:PackIcon Kind="Link" />
                            </Hyperlink>
                        </TextBlock>

                        <StackPanel Grid.Row="2" Orientation="Horizontal">
                            <TextBlock
                                Margin="{StaticResource Margin8}"
                                VerticalAlignment="Center"
                                Style="{StaticResource ToolbarTextBlock}"
                                Text="{x:Static resx:ResUI.TbFullConfigTemplateEnable}" />
                            <ToggleButton
                                x:Name="rayFullConfigTemplateEnable"
                                Margin="{StaticResource Margin8}"
                                HorizontalAlignment="Left" />
                        </StackPanel>
                    </Grid>

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

                        <StackPanel Orientation="Horizontal">
                            <TextBlock
                                Margin="{StaticResource Margin8}"
                                VerticalAlignment="Center"
                                Style="{StaticResource ToolbarTextBlock}"
                                Text="{x:Static resx:ResUI.TbSetUpstreamProxyDetour}" />
                            <TextBox
                                x:Name="txtProxyDetour4Ray"
                                Width="200"
                                Margin="{StaticResource Margin8}"
                                Style="{StaticResource DefTextBox}" />
                        </StackPanel>
                    </WrapPanel>

                    <TextBox
                        x:Name="rayFullConfigTemplate"
                        Margin="{StaticResource Margin8}"
                        VerticalAlignment="Stretch"
                        materialDesign:HintAssist.Hint="xray config template json"
                        AcceptsReturn="True"
                        BorderThickness="1"
                        Style="{StaticResource MaterialDesignOutlinedTextBox}"
                        TextWrapping="Wrap"
                        VerticalScrollBarVisibility="Auto" />
                </DockPanel>
            </TabItem>
            <TabItem HorizontalAlignment="Left" Header="{x:Static resx:ResUI.TbSBFullConfigTemplate}">
                <DockPanel Margin="{StaticResource Margin8}">
                    <Grid DockPanel.Dock="Top">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <TextBlock
                            Grid.Row="0"
                            Margin="{StaticResource Margin8}"
                            VerticalAlignment="Center"
                            Style="{StaticResource ToolbarTextBlock}"
                            Text="{x:Static resx:ResUI.TbFullConfigTemplateDesc}"
                            TextWrapping="Wrap" />

                        <TextBlock
                            Grid.Row="1"
                            Margin="{StaticResource Margin8}"
                            VerticalAlignment="Center"
                            Style="{StaticResource ToolbarTextBlock}">
                            <Hyperlink Click="linkFullConfigTemplateDoc_Click">
                                <TextBlock Text="{x:Static resx:ResUI.TbSBFullConfigTemplateDesc}" />
                                <materialDesign:PackIcon Kind="Link" />
                            </Hyperlink>
                        </TextBlock>

                        <StackPanel Grid.Row="2" Orientation="Horizontal">
                            <TextBlock
                                Margin="{StaticResource Margin8}"
                                VerticalAlignment="Center"
                                Style="{StaticResource ToolbarTextBlock}"
                                Text="{x:Static resx:ResUI.TbFullConfigTemplateEnable}" />
                            <ToggleButton
                                x:Name="sbFullConfigTemplateEnable"
                                Margin="{StaticResource Margin8}"
                                HorizontalAlignment="Left" />
                        </StackPanel>
                    </Grid>

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

                        <StackPanel Orientation="Horizontal">
                            <TextBlock
                                Margin="{StaticResource Margin8}"
                                VerticalAlignment="Center"
                                Style="{StaticResource ToolbarTextBlock}"
                                Text="{x:Static resx:ResUI.TbSetUpstreamProxyDetour}" />
                            <TextBox
                                x:Name="txtProxyDetour4Singbox"
                                Width="200"
                                Margin="{StaticResource Margin8}"
                                Style="{StaticResource DefTextBox}" />
                        </StackPanel>
                    </WrapPanel>

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

                        <TextBox
                            x:Name="sbFullConfigTemplate"
                            Grid.Column="0"
                            VerticalAlignment="Stretch"
                            materialDesign:HintAssist.Hint="sing-box config template json"
                            AcceptsReturn="True"
                            BorderThickness="1"
                            Style="{StaticResource MaterialDesignOutlinedTextBox}"
                            TextWrapping="Wrap"
                            VerticalScrollBarVisibility="Auto" />

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

                        <TextBox
                            x:Name="sbFullTunConfigTemplate"
                            Grid.Column="2"
                            VerticalAlignment="Stretch"
                            materialDesign:HintAssist.Hint="sing-box tun config template json"
                            AcceptsReturn="True"
                            BorderThickness="1"
                            Style="{StaticResource MaterialDesignOutlinedTextBox}"
                            TextWrapping="Wrap"
                            VerticalScrollBarVisibility="Auto" />
                    </Grid>
                </DockPanel>
            </TabItem>
        </TabControl>
    </DockPanel>
</base:WindowBase>
