<base:WindowBase
    x:Class="v2rayN.Views.RoutingRuleDetailsWindow"
    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.menuRoutingRuleDetailsSetting}"
    Width="900"
    Height="700"
    x:TypeArguments="vms:RoutingRuleDetailsViewModel"
    ShowInTaskbar="False"
    Style="{StaticResource WindowGlobal}"
    WindowStartupLocation="CenterScreen"
    mc:Ignorable="d">
    <DockPanel>
        <Grid Margin="{StaticResource Margin8}" DockPanel.Dock="Top">
            <Grid.RowDefinitions>
                <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="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBlock
                Grid.Row="0"
                Grid.Column="0"
                Margin="{StaticResource Margin4}"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="{x:Static resx:ResUI.LvRemarks}" />
            <TextBox
                x:Name="txtRemarks"
                Grid.Row="0"
                Grid.Column="1"
                Width="200"
                Margin="{StaticResource Margin4}"
                HorizontalAlignment="Left"
                Style="{StaticResource DefTextBox}" />
            <StackPanel
                Grid.Row="0"
                Grid.Column="2"
                Margin="{StaticResource Margin4}"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Orientation="Horizontal">
                <ToggleButton
                    x:Name="togEnabled"
                    Margin="{StaticResource Margin4}"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center" />
            </StackPanel>

            <TextBlock
                Grid.Row="1"
                Grid.Column="0"
                Margin="{StaticResource Margin4}"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="{x:Static resx:ResUI.TbRuleType}" />
            <ComboBox
                x:Name="cmbRuleType"
                Grid.Row="1"
                Grid.Column="1"
                Width="200"
                Margin="{StaticResource Margin4}"
                MaxDropDownHeight="1000"
                Style="{StaticResource DefComboBox}" />
            <TextBlock
                Grid.Row="1"
                Grid.Column="2"
                Margin="{StaticResource Margin4}"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="{x:Static resx:ResUI.TbRuleTypeTips}" />

            <TextBlock
                Grid.Row="2"
                Grid.Column="0"
                Margin="{StaticResource Margin4}"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="outboundTag" />
            <ComboBox
                x:Name="cmbOutboundTag"
                Grid.Row="2"
                Grid.Column="1"
                Width="200"
                Margin="{StaticResource Margin4}"
                IsEditable="True"
                MaxDropDownHeight="1000"
                Style="{StaticResource DefComboBox}" />
            <StackPanel
                Grid.Row="2"
                Grid.Column="2"
                Margin="{StaticResource Margin4}"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Orientation="Horizontal">
                <Button
                    Margin="{StaticResource Margin4}"
                    Click="BtnSelectProfile_Click"
                    Content="{x:Static resx:ResUI.TbSelectProfile}"
                    Style="{StaticResource DefButton}" />
                <TextBlock
                    Margin="{StaticResource Margin4}"
                    VerticalAlignment="Center"
                    Style="{StaticResource ToolbarTextBlock}"
                    Text="{x:Static resx:ResUI.TbRuleOutboundTagTip}" />
            </StackPanel>

            <TextBlock
                Grid.Row="3"
                Grid.Column="0"
                Margin="{StaticResource Margin4}"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="port" />
            <TextBox
                x:Name="txtPort"
                Grid.Row="3"
                Grid.Column="1"
                Width="200"
                Margin="{StaticResource Margin4}"
                HorizontalAlignment="Left"
                Style="{StaticResource DefTextBox}" />
            <TextBlock
                Grid.Row="3"
                Grid.Column="2"
                Margin="{StaticResource Margin4}"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="{x:Static resx:ResUI.TbRuleMatchingTips}" />

            <TextBlock
                Grid.Row="4"
                Grid.Column="0"
                Margin="{StaticResource Margin4}"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="protocol" />
            <ListBox
                x:Name="clbProtocol"
                Grid.Row="4"
                Grid.Column="1"
                Margin="{StaticResource Margin4}"
                HorizontalAlignment="Left"
                FontSize="{DynamicResource StdFontSize}"
                Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
            <TextBlock
                Grid.Row="4"
                Grid.Column="2"
                Margin="{StaticResource Margin4}"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}">
                <Hyperlink Click="linkRuleobjectDoc_Click">
                    <TextBlock Text="{x:Static resx:ResUI.TbRuleobjectDoc}" />
                    <materialDesign:PackIcon Kind="Link" />
                </Hyperlink>
            </TextBlock>

            <TextBlock
                Grid.Row="5"
                Grid.Column="0"
                Margin="{StaticResource Margin4}"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="inboundTag" />
            <ListBox
                x:Name="clbInboundTag"
                Grid.Row="5"
                Grid.Column="1"
                Margin="{StaticResource Margin4}"
                FontSize="{DynamicResource StdFontSize}"
                Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
            <TextBlock
                Grid.Row="5"
                Grid.Column="2"
                Margin="{StaticResource Margin4}"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="{x:Static resx:ResUI.TbRoutingInboundTagTips}" />

            <TextBlock
                Grid.Row="6"
                Grid.Column="0"
                Margin="{StaticResource Margin4}"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="network" />
            <ComboBox
                x:Name="cmbNetwork"
                Grid.Row="6"
                Grid.Column="1"
                Width="200"
                Margin="{StaticResource Margin4}"
                MaxDropDownHeight="1000"
                Style="{StaticResource DefComboBox}" />

            <TextBlock
                Grid.Row="6"
                Grid.Column="2"
                Margin="{StaticResource Margin4}"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="{x:Static resx:ResUI.TbRoutingTips}" />
        </Grid>

        <StackPanel
            Margin="{StaticResource Margin8}"
            HorizontalAlignment="Right"
            DockPanel.Dock="Bottom"
            Orientation="Horizontal">
            <StackPanel
                Width="600"
                HorizontalAlignment="Center"
                VerticalAlignment="Center">
                <CheckBox x:Name="chkAutoSort">
                    <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.TbAutoSort}" />
                </CheckBox>
            </StackPanel>
            <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>

        <Grid Margin="{StaticResource Margin8}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="1*" />
            </Grid.ColumnDefinitions>
            <GroupBox
                Grid.Column="0"
                Header="{x:Static resx:ResUI.TbRoutingRuleDomain}"
                Style="{StaticResource MyGroupBox}">
                <TextBox
                    Name="txtDomain"
                    AcceptsReturn="True"
                    Style="{StaticResource DefTextBox}"
                    TextWrapping="Wrap"
                    VerticalScrollBarVisibility="Auto" />
            </GroupBox>
            <GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" />
            <GroupBox
                Grid.Column="2"
                Header="{x:Static resx:ResUI.TbRoutingRuleIP}"
                Style="{StaticResource MyGroupBox}">
                <TextBox
                    Name="txtIP"
                    AcceptsReturn="True"
                    Style="{StaticResource DefTextBox}"
                    TextWrapping="Wrap"
                    VerticalScrollBarVisibility="Auto" />
            </GroupBox>
            <GridSplitter Grid.Column="3" HorizontalAlignment="Stretch" />
            <GroupBox
                Grid.Column="4"
                Header="{x:Static resx:ResUI.TbRoutingRuleProcess}"
                Style="{StaticResource MyGroupBox}">
                <TextBox
                    Name="txtProcess"
                    AcceptsReturn="True"
                    Style="{StaticResource DefTextBox}"
                    TextWrapping="Wrap"
                    VerticalScrollBarVisibility="Auto" />
            </GroupBox>
        </Grid>
    </DockPanel>
</base:WindowBase>
