<reactiveui:ReactiveWindow
    x:Class="v2rayN.Views.RoutingRuleDetailsWindow"
    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.menuRoutingRuleDetailsSetting}"
    Width="900"
    Height="700"
    x:TypeArguments="vms:RoutingRuleDetailsViewModel"
    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">
    <DockPanel>
        <Grid Margin="8" DockPanel.Dock="Top">
            <Grid.RowDefinitions>
                <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" />
            </Grid.ColumnDefinitions>
            <TextBlock
                Grid.Row="0"
                Grid.Column="0"
                Margin="4"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="outboundTag" />
            <ComboBox
                x:Name="cmbOutboundTag"
                Grid.Row="0"
                Grid.Column="1"
                Width="200"
                Margin="4"
                MaxDropDownHeight="1000"
                Style="{StaticResource DefComboBox}" />

            <TextBlock
                Grid.Row="1"
                Grid.Column="0"
                Margin="4"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="port" />
            <TextBox
                x:Name="txtPort"
                Grid.Row="1"
                Grid.Column="1"
                Width="200"
                Margin="4"
                HorizontalAlignment="Left" />

            <TextBlock
                Grid.Row="2"
                Grid.Column="0"
                Margin="4"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="protocol" />
            <ListBox
                x:Name="clbProtocol"
                Grid.Row="2"
                Grid.Column="1"
                Margin="4"
                HorizontalAlignment="Left"
                Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />

            <TextBlock
                Grid.Row="3"
                Grid.Column="0"
                Margin="4"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="inboundTag" />
            <ListBox
                x:Name="clbInboundTag"
                Grid.Row="3"
                Grid.Column="1"
                Margin="4"
                Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />

            <TextBlock
                Grid.Row="4"
                Grid.Column="0"
                Margin="4"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}"
                Text="enabled" />
            <ToggleButton
                x:Name="togEnabled"
                Grid.Row="4"
                Grid.Column="1"
                Margin="4"
                HorizontalAlignment="Left" />

            <TextBlock
                Grid.Row="5"
                Grid.Column="0"
                Margin="4"
                VerticalAlignment="Center"
                Style="{StaticResource ToolbarTextBlock}">
                <Hyperlink Click="linkRuleobjectDoc_Click">
                    <TextBlock Text="{x:Static resx:ResUI.TbRuleobjectDoc}" />
                </Hyperlink>
            </TextBlock>
            <TextBlock
                Grid.Row="5"
                Grid.Column="1"
                Margin="4"
                HorizontalAlignment="Left"
                Style="{StaticResource ToolbarTextBlock}"
                Text="{x:Static resx:ResUI.TbRoutingTips}" />
        </Grid>

        <Grid
            Margin="16"
            HorizontalAlignment="Center"
            DockPanel.Dock="Bottom">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="600" />
                <ColumnDefinition Width="100" />
                <ColumnDefinition Width="100" />
            </Grid.ColumnDefinitions>
            <StackPanel
                Grid.Column="0"
                HorizontalAlignment="Left"
                VerticalAlignment="Center">
                <CheckBox x:Name="chkAutoSort">
                    <TextBlock Text="{x:Static resx:ResUI.TbAutoSort}" />
                </CheckBox>
            </StackPanel>
            <Button
                x:Name="btnSave"
                Grid.Column="1"
                Margin="4"
                Content="{x:Static resx:ResUI.TbConfirm}"
                Cursor="Hand"
                Style="{StaticResource DefButton}" />
            <Button
                x:Name="btnCancel"
                Grid.Column="2"
                Margin="4"
                Content="{x:Static resx:ResUI.TbCancel}"
                Cursor="Hand"
                IsCancel="true"
                Style="{StaticResource DefButton}" />
        </Grid>

        <Grid Margin="{StaticResource SettingItemMargin}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="1*" />
            </Grid.ColumnDefinitions>
            <GroupBox
                Grid.Column="0"
                Header="Domain"
                Style="{StaticResource MaterialDesignGroupBox}">
                <TextBox
                    Name="txtDomain"
                    AcceptsReturn="True"
                    TextWrapping="Wrap"
                    VerticalScrollBarVisibility="Auto" />
            </GroupBox>
            <GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" />
            <GroupBox
                Grid.Column="2"
                Header="IP"
                Style="{StaticResource MaterialDesignGroupBox}">
                <TextBox
                    Name="txtIP"
                    AcceptsReturn="True"
                    TextWrapping="Wrap"
                    VerticalScrollBarVisibility="Auto" />
            </GroupBox>
        </Grid>
    </DockPanel>
</reactiveui:ReactiveWindow>
