<reactiveui:ReactiveUserControl
    x:Class="v2rayN.Views.StatusBarView"
    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:tb="clr-namespace:H.NotifyIcon;assembly=H.NotifyIcon.Wpf"
    xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
    d:DesignHeight="450"
    d:DesignWidth="800"
    x:TypeArguments="vms:StatusBarViewModel"
    Style="{StaticResource ViewGlobal}"
    mc:Ignorable="d">
    <Grid>
        <materialDesign:ColorZone
            Height="auto"
            Margin="{StaticResource Margin4}"
            Mode="Standard">
            <DockPanel>
                <StackPanel
                    Margin="{StaticResource MarginLeftRight8}"
                    VerticalAlignment="Center"
                    DockPanel.Dock="Right">
                    <TextBlock
                        x:Name="txtSpeedProxyDisplay"
                        HorizontalAlignment="Right"
                        Style="{StaticResource StatusbarItem}" />
                    <Border Margin="1" />
                    <TextBlock
                        x:Name="txtSpeedDirectDisplay"
                        HorizontalAlignment="Right"
                        Style="{StaticResource StatusbarItem}" />
                </StackPanel>

                <StackPanel
                    Width="Auto"
                    Margin="{StaticResource MarginLeftRight8}"
                    VerticalAlignment="Center"
                    DockPanel.Dock="Left">
                    <TextBlock x:Name="txtInboundDisplay" Style="{StaticResource StatusbarItem}" />
                    <Border Margin="1" />
                    <TextBlock x:Name="txtInboundLanDisplay" Style="{StaticResource StatusbarItem}" />
                </StackPanel>

                <StackPanel
                    x:Name="spEnableTun"
                    Width="Auto"
                    Margin="{StaticResource MarginLeftRight8}"
                    VerticalAlignment="Center"
                    DockPanel.Dock="Left"
                    Orientation="Horizontal">
                    <TextBlock
                        Margin="{StaticResource MarginLeftRight8}"
                        VerticalAlignment="Center"
                        Style="{StaticResource StatusbarItem}"
                        Text="{x:Static resx:ResUI.TbEnableTunAs}" />
                    <ToggleButton
                        x:Name="togEnableTun"
                        Margin="{StaticResource Margin4}"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Center"
                        AutomationProperties.Name="{x:Static resx:ResUI.TbEnableTunAs}" />
                </StackPanel>

                <StackPanel
                    Margin="{StaticResource MarginLeftRight8}"
                    VerticalAlignment="Center"
                    DockPanel.Dock="Left"
                    Orientation="Horizontal">
                    <ComboBox
                        x:Name="cmbSystemProxy"
                        Width="160"
                        Margin="{StaticResource MarginLeftRight8}"
                        materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuSystemproxy}"
                        AutomationProperties.Name="{x:Static resx:ResUI.menuSystemproxy}"
                        FontSize="{DynamicResource StdFontSize}"
                        Style="{StaticResource MaterialDesignFloatingHintComboBox}">
                        <ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxyClear}" />
                        <ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxySet}" />
                        <ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxyNothing}" />
                        <ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxyPac}" />
                    </ComboBox>

                    <ComboBox
                        x:Name="cmbRoutings2"
                        Width="160"
                        Margin="{StaticResource MarginLeftRight8}"
                        materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuRouting}"
                        AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
                        DisplayMemberPath="Remarks"
                        FontSize="{DynamicResource StdFontSize}"
                        Style="{StaticResource MaterialDesignFloatingHintComboBox}" />
                </StackPanel>

                <StackPanel Margin="{StaticResource MarginLeftRight8}" VerticalAlignment="Center">
                    <TextBlock x:Name="txtRunningServerDisplay" Style="{StaticResource StatusbarItem}" />
                    <Border Margin="1" />
                    <TextBlock x:Name="txtRunningInfoDisplay" Style="{StaticResource StatusbarItem}" />
                </StackPanel>
            </DockPanel>
        </materialDesign:ColorZone>

        <tb:TaskbarIcon
            x:Name="tbNotify"
            IconSource="/Resources/v2rayN.ico"
            NoLeftClickDelay="True"
            ToolTipText="v2rayN">
            <tb:TaskbarIcon.ContextMenu>
                <ContextMenu Style="{StaticResource DefContextMenu}">
                    <MenuItem
                        x:Name="menuSystemProxyClear"
                        Height="{StaticResource MenuItemHeight}"
                        AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxyClear}">
                        <MenuItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <materialDesign:PackIcon
                                    x:Name="menuSystemProxyClear2"
                                    Margin="{StaticResource MarginRight8}"
                                    VerticalAlignment="Center"
                                    Kind="Check" />
                                <TextBlock Text="{x:Static resx:ResUI.menuSystemProxyClear}" />
                            </StackPanel>
                        </MenuItem.Header>
                    </MenuItem>
                    <MenuItem
                        x:Name="menuSystemProxySet"
                        Height="{StaticResource MenuItemHeight}"
                        AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxySet}">
                        <MenuItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <materialDesign:PackIcon
                                    x:Name="menuSystemProxySet2"
                                    Margin="{StaticResource MarginRight8}"
                                    VerticalAlignment="Center"
                                    Kind="Check" />
                                <TextBlock Text="{x:Static resx:ResUI.menuSystemProxySet}" />
                            </StackPanel>
                        </MenuItem.Header>
                    </MenuItem>
                    <MenuItem
                        x:Name="menuSystemProxyNothing"
                        Height="{StaticResource MenuItemHeight}"
                        AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxyNothing}">
                        <MenuItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <materialDesign:PackIcon
                                    x:Name="menuSystemProxyNothing2"
                                    Margin="{StaticResource MarginRight8}"
                                    VerticalAlignment="Center"
                                    Kind="Check" />
                                <TextBlock Text="{x:Static resx:ResUI.menuSystemProxyNothing}" />
                            </StackPanel>
                        </MenuItem.Header>
                    </MenuItem>
                    <MenuItem
                        x:Name="menuSystemProxyPac"
                        Height="{StaticResource MenuItemHeight}"
                        AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxyPac}">
                        <MenuItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <materialDesign:PackIcon
                                    x:Name="menuSystemProxyPac2"
                                    Margin="{StaticResource MarginRight8}"
                                    VerticalAlignment="Center"
                                    Kind="Check" />
                                <TextBlock Text="{x:Static resx:ResUI.menuSystemProxyPac}" />
                            </StackPanel>
                        </MenuItem.Header>
                    </MenuItem>
                    <Separator x:Name="sepRoutings" />
                    <MenuItem
                        x:Name="menuRoutings"
                        Height="Auto"
                        AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}">
                        <MenuItem.Header>
                            <DockPanel>
                                <ComboBox
                                    x:Name="cmbRoutings"
                                    MaxWidth="300"
                                    materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuRouting}"
                                    AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
                                    DisplayMemberPath="Remarks"
                                    FontSize="{DynamicResource StdFontSize}"
                                    Style="{StaticResource MaterialDesignFilledComboBox}" />
                            </DockPanel>
                        </MenuItem.Header>
                    </MenuItem>
                    <MenuItem Height="Auto" AutomationProperties.Name="{x:Static resx:ResUI.menuServers}">
                        <MenuItem.Header>
                            <DockPanel>
                                <ComboBox
                                    x:Name="cmbServers"
                                    MaxWidth="300"
                                    materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuServers}"
                                    AutomationProperties.Name="{x:Static resx:ResUI.menuServers}"
                                    DisplayMemberPath="Text"
                                    FontSize="{DynamicResource StdFontSize}"
                                    Style="{StaticResource MaterialDesignFilledComboBox}" />
                            </DockPanel>
                        </MenuItem.Header>
                    </MenuItem>
                    <Separator />
                    <MenuItem
                        x:Name="menuAddServerViaClipboard2"
                        Height="{StaticResource MenuItemHeight}"
                        Header="{x:Static resx:ResUI.menuAddServerViaClipboard}" />
                    <MenuItem
                        x:Name="menuAddServerViaScan2"
                        Height="{StaticResource MenuItemHeight}"
                        Header="{x:Static resx:ResUI.menuAddServerViaScan}" />
                    <MenuItem
                        x:Name="menuSubUpdate2"
                        Height="{StaticResource MenuItemHeight}"
                        Header="{x:Static resx:ResUI.menuSubUpdate}" />
                    <MenuItem
                        x:Name="menuSubUpdateViaProxy2"
                        Height="{StaticResource MenuItemHeight}"
                        Header="{x:Static resx:ResUI.menuSubUpdateViaProxy}" />
                    <Separator />
                    <MenuItem
                        x:Name="menuCopyProxyCmdToClipboard"
                        Height="{StaticResource MenuItemHeight}"
                        Header="{x:Static resx:ResUI.menuCopyProxyCmdToClipboard}" />
                    <Separator />
                    <MenuItem
                        x:Name="menuExit"
                        Height="{StaticResource MenuItemHeight}"
                        Header="{x:Static resx:ResUI.menuExit}" />
                </ContextMenu>
            </tb:TaskbarIcon.ContextMenu>
        </tb:TaskbarIcon>
    </Grid>
</reactiveui:ReactiveUserControl>
