<reactiveui:ReactiveWindow
    x:Class="v2rayN.Views.AddServerWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:conv="clr-namespace:v2rayN.Converters"
    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:v2rayN.Resx"
    xmlns:vms="clr-namespace:v2rayN.ViewModels"
    Title="{x:Static resx:ResUI.menuServers}"
    Width="800"
    Height="800"
    x:TypeArguments="vms:AddServerViewModel"
    Background="{DynamicResource MaterialDesignPaper}"
    FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
    ResizeMode="NoResize"
    TextElement.FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
    TextElement.Foreground="{DynamicResource MaterialDesignBody}"
    TextOptions.TextFormattingMode="Display"
    TextOptions.TextRenderingMode="Auto"
    WindowStartupLocation="CenterScreen"
    mc:Ignorable="d">
    <ScrollViewer
        materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True"
        HorizontalScrollBarVisibility="Auto"
        VerticalScrollBarVisibility="Auto">
        <Grid Margin="8">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock
                    Grid.Row="0"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource ModuleTitle}"
                    Text="{x:Static resx:ResUI.menuServers}" />
                <StackPanel
                    Grid.Row="0"
                    Grid.Column="2"
                    Orientation="Horizontal">
                    <ComboBox
                        x:Name="cmbCoreType"
                        Width="100"
                        Margin="{StaticResource ServerItemMargin}"
                        materialDesign:HintAssist.Hint="{x:Static resx:ResUI.TbCoreType}"
                        Style="{StaticResource DefComboBox}" />
                </StackPanel>

                <TextBlock
                    Grid.Row="1"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbRemarks}" />
                <TextBox
                    x:Name="txtRemarks"
                    Grid.Row="1"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}" />

                <TextBlock
                    Grid.Row="2"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbAddress}" />
                <TextBox
                    x:Name="txtAddress"
                    Grid.Row="2"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}" />

                <TextBlock
                    Grid.Row="3"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbPort}" />
                <TextBox
                    x:Name="txtPort"
                    Grid.Row="3"
                    Grid.Column="1"
                    Width="100"
                    Margin="{StaticResource ServerItemMargin}"
                    HorizontalAlignment="Left" />
            </Grid>

            <Separator
                Grid.Row="1"
                Margin="0,2"
                Style="{DynamicResource MaterialDesignSeparator}" />

            <Grid
                x:Name="gridVMess"
                Grid.Row="2"
                Visibility="Hidden">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock
                    Grid.Row="1"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbId}" />
                <TextBox
                    x:Name="txtId"
                    Grid.Row="1"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}" />
                <Button
                    x:Name="btnGUID"
                    Grid.Row="1"
                    Grid.Column="2"
                    Margin="4,0"
                    Click="btnGUID_Click"
                    Content="{x:Static resx:ResUI.TbGUID}"
                    Style="{StaticResource DefButton}" />

                <TextBlock
                    Grid.Row="2"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbAlterId}" />
                <TextBox
                    x:Name="txtAlterId"
                    Grid.Row="2"
                    Grid.Column="1"
                    Width="100"
                    Margin="{StaticResource ServerItemMargin}"
                    HorizontalAlignment="Left" />

                <TextBlock
                    Grid.Row="3"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbSecurity}" />
                <ComboBox
                    x:Name="cmbSecurity"
                    Grid.Row="3"
                    Grid.Column="1"
                    Width="200"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource DefComboBox}" />

            </Grid>
            <Grid
                x:Name="gridSs"
                Grid.Row="2"
                Visibility="Hidden">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock
                    Grid.Row="1"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbId3}" />
                <TextBox
                    x:Name="txtId3"
                    Grid.Row="1"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}" />

                <TextBlock
                    Grid.Row="2"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbSecurity3}" />
                <ComboBox
                    x:Name="cmbSecurity3"
                    Grid.Row="2"
                    Grid.Column="1"
                    Width="300"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource DefComboBox}" />

            </Grid>
            <Grid
                x:Name="gridSocks"
                Grid.Row="2"
                Visibility="Hidden">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock
                    Grid.Row="1"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbSecurity4}" />
                <TextBox
                    x:Name="txtSecurity4"
                    Grid.Row="1"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}" />

                <TextBlock
                    Grid.Row="2"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbId4}" />
                <TextBox
                    x:Name="txtId4"
                    Grid.Row="2"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}" />

            </Grid>
            <Grid
                x:Name="gridVLESS"
                Grid.Row="2"
                Visibility="Hidden">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock
                    Grid.Row="1"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbId5}" />
                <TextBox
                    x:Name="txtId5"
                    Grid.Row="1"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}" />
                <Button
                    x:Name="btnGUID5"
                    Grid.Row="1"
                    Grid.Column="2"
                    Margin="4,0"
                    Click="btnGUID_Click"
                    Content="{x:Static resx:ResUI.TbGUID}"
                    Style="{StaticResource DefButton}" />

                <TextBlock
                    Grid.Row="2"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbFlow5}" />
                <ComboBox
                    x:Name="cmbFlow5"
                    Grid.Row="2"
                    Grid.Column="1"
                    Width="200"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource DefComboBox}" />

                <TextBlock
                    Grid.Row="3"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbSecurity5}" />
                <TextBox
                    x:Name="txtSecurity5"
                    Grid.Row="3"
                    Grid.Column="1"
                    Width="200"
                    Margin="{StaticResource ServerItemMargin}"
                    HorizontalAlignment="Left" />
            </Grid>
            <Grid
                x:Name="gridTrojan"
                Grid.Row="2"
                Visibility="Hidden">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock
                    Grid.Row="1"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbId3}" />
                <TextBox
                    x:Name="txtId6"
                    Grid.Row="1"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}" />

                <TextBlock
                    Grid.Row="2"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbFlow5}" />
                <ComboBox
                    x:Name="cmbFlow6"
                    Grid.Row="2"
                    Grid.Column="1"
                    Width="200"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource DefComboBox}" />
            </Grid>

            <Separator
                Grid.Row="3"
                Margin="0,2"
                Style="{DynamicResource MaterialDesignSeparator}" />

            <Grid Grid.Row="4">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock
                    Grid.Row="0"
                    Grid.ColumnSpan="2"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource ModuleTitle}"
                    Text="{x:Static resx:ResUI.GbTransport}" />

                <TextBlock
                    Grid.Row="1"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbNetwork}" />
                <ComboBox
                    x:Name="cmbNetwork"
                    Grid.Row="1"
                    Grid.Column="1"
                    Width="100"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource DefComboBox}" />
                <TextBlock
                    Grid.Row="1"
                    Grid.Column="2"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TipNetwork}" />

                <TextBlock
                    x:Name="labHeaderType"
                    Grid.Row="2"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbHeaderType}" />
                <ComboBox
                    x:Name="cmbHeaderType"
                    Grid.Row="2"
                    Grid.Column="1"
                    Width="100"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource DefComboBox}" />
                <TextBlock
                    x:Name="tipHeaderType"
                    Grid.Row="2"
                    Grid.Column="2"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbHeaderType}" />

                <TextBlock
                    Grid.Row="3"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbRequestHost}" />
                <TextBox
                    x:Name="txtRequestHost"
                    Grid.Row="3"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}" />
                <TextBlock
                    x:Name="tipRequestHost"
                    Grid.Row="3"
                    Grid.Column="2"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbRequestHost}" />

                <TextBlock
                    Grid.Row="4"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbPath}" />
                <TextBox
                    x:Name="txtPath"
                    Grid.Row="4"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}" />
                <TextBlock
                    x:Name="tipPath"
                    Grid.Row="4"
                    Grid.Column="2"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbPath}" />

            </Grid>

            <Separator
                Grid.Row="5"
                Margin="0,2"
                Style="{DynamicResource MaterialDesignSeparator}" />

            <Grid Grid.Row="6">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock
                    Grid.Row="0"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbStreamSecurity}" />
                <ComboBox
                    x:Name="cmbStreamSecurity"
                    Grid.Row="0"
                    Grid.Column="1"
                    Width="100"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource DefComboBox}" />
            </Grid>

            <Grid x:Name="gridTlsMore" Grid.Row="7">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock
                    Grid.Row="1"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbSNI}" />
                <TextBox
                    x:Name="txtSNI"
                    Grid.Row="1"
                    Grid.Column="1"
                    Width="400"
                    Margin="{StaticResource ServerItemMargin}"
                    HorizontalAlignment="Left" />

                <TextBlock
                    Grid.Row="2"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbAllowInsecure}" />
                <ComboBox
                    x:Name="cmbAllowInsecure"
                    Grid.Row="2"
                    Grid.Column="1"
                    Width="100"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource DefComboBox}" />

                <TextBlock
                    Grid.Row="3"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbFingerprint}" />
                <ComboBox
                    x:Name="cmbFingerprint"
                    Grid.Row="3"
                    Grid.Column="1"
                    Width="200"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource DefComboBox}" />

                <TextBlock
                    Grid.Row="4"
                    Grid.Column="0"
                    Margin="{StaticResource ServerItemMargin}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbAlpn}" />
                <ComboBox
                    x:Name="cmbAlpn"
                    Grid.Row="4"
                    Grid.Column="1"
                    Width="200"
                    Margin="{StaticResource ServerItemMargin}"
                    Style="{StaticResource DefComboBox}" />
            </Grid>

            <Separator
                Grid.Row="8"
                Margin="0,2"
                Style="{DynamicResource MaterialDesignSeparator}" />

            <Grid
                Grid.Row="9"
                Margin="16"
                HorizontalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="200" />
                    <ColumnDefinition Width="200" />
                </Grid.ColumnDefinitions>
                <Button
                    x:Name="btnSave"
                    Grid.Column="0"
                    Margin="4"
                    Content="{x:Static resx:ResUI.TbConfirm}"
                    Cursor="Hand"
                    Style="{StaticResource DefButton}" />
                <Button
                    x:Name="btnCancel"
                    Grid.Column="1"
                    Margin="4"
                    Click="btnCancel_Click"
                    Content="{x:Static resx:ResUI.TbCancel}"
                    Cursor="Hand"
                    IsCancel="true"
                    Style="{StaticResource DefButton}" />
            </Grid>

        </Grid>
    </ScrollViewer>
</reactiveui:ReactiveWindow>
