<UserControl x:Class="NETworkManager.Views.SNMPView"
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:Converter="clr-namespace:NETworkManager.Converters"
        xmlns:Validator="clr-namespace:NETworkManager.Validators"
        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"        
        xmlns:IconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
        mc:Ignorable="d">
    <UserControl.Resources>
        <Converter:BooleanReverseToVisibilityConverter x:Key="BooleanReverseToVisibilityConverter" />
        <Converter:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <Converter:BooleanReverseConverter x:Key="BooleanReverseConverter" />
        <Converter:IntToStringConverter x:Key="IntToStringConverter" />
        <Converter:NullableDateTimeToStringConverter x:Key="NullableDateTimeToStringConverter" />
    </UserControl.Resources>
    <Grid Margin="10">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="10" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="20" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_Header_SNMP}" />
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="1*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="10" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Column="0" Grid.Row="0" Text="{DynamicResource String_Host}" Style="{StaticResource CenterTextBlock}" />
            <ComboBox Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="3" x:Name="cbHost" Height="{Binding ElementName=cbOID, Path=ActualHeight}" ItemsSource="{Binding HostHistoryView}" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExampleHostnameOrIPAddress}" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}" Style="{StaticResource HistoryComboBox}">
                <ComboBox.Text>
                    <Binding Path="Host" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                        <Binding.ValidationRules>
                            <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                        </Binding.ValidationRules>
                    </Binding>
                </ComboBox.Text>
            </ComboBox>
            <TextBlock Grid.Column="6" Grid.Row="0" Text="{DynamicResource String_Version}" Style="{StaticResource CenterTextBlock}" />
            <ComboBox Grid.Column="8" Grid.Row="0" ItemsSource="{Binding Versions}" SelectedItem="{Binding Version}" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}" />
            <TextBlock Grid.Column="10" Grid.Row="0" Text="{DynamicResource String_Mode}" Style="{StaticResource CenterTextBlock}" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}" />
            <ComboBox Grid.Column="12" Grid.Row="0" ItemsSource="{Binding Modes}" SelectedItem="{Binding Mode}" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}" />
            <TextBlock Grid.Column="0" Grid.Row="2" Text="{DynamicResource String_OID}" Style="{StaticResource CenterTextBlock}" />
            <ComboBox Grid.Column="2" Grid.Row="2" Grid.ColumnSpan="3" x:Name="cbOID" Height="{Binding ElementName=btnQuery, Path=ActualHeight}" ItemsSource="{Binding OIDHistoryView}" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExampleSNMPOID}" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}" Style="{StaticResource HistoryComboBox}">
                <ComboBox.Text>
                    <Binding Path="OID" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                        <Binding.ValidationRules>
                            <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                            <Validator:OIDValidator ValidatesOnTargetUpdated="True" />
                        </Binding.ValidationRules>
                    </Binding>
                </ComboBox.Text>
            </ComboBox>
            <TextBlock Grid.Column="6" Grid.Row="2" Text="{DynamicResource String_Community}">
                <TextBlock.Style>
                    <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource CenterTextBlock}">
                        <Setter Property="Visibility" Value="Visible" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Version}" Value="v3">
                                <Setter Property="Visibility" Value="Collapsed" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
            <TextBox Grid.Column="8" Grid.Row="2" Grid.ColumnSpan="5" Name="txtCommunity" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExampleSNMPCommunity}" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}">
                <TextBox.Style>
                    <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBox}">
                        <Setter Property="Visibility" Value="Visible" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Version}" Value="v3">
                                <Setter Property="Visibility" Value="Collapsed" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBox.Style>
                <TextBox.Text>
                    <Binding Path="Community" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                        <Binding.ValidationRules>
                            <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Column="6" Grid.Row="2" Text="{DynamicResource String_Security}">
                <TextBlock.Style>
                    <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource CenterTextBlock}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Version}" Value="v3">
                                <Setter Property="Visibility" Value="Visible" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
            <ComboBox Grid.Column="8" Grid.Row="2" ItemsSource="{Binding Securitys}" SelectedItem="{Binding Security}" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}">
                <ComboBox.Style>
                    <Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource DefaultComboBox}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Version}" Value="v3">
                                <Setter Property="Visibility" Value="Visible" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ComboBox.Style>
            </ComboBox>
            <TextBlock Grid.Column="10" Grid.Row="2" Text="{DynamicResource String_Username}">
                <TextBlock.Style>
                    <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource CenterTextBlock}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Version}" Value="v3">
                                <Setter Property="Visibility" Value="Visible" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
            <TextBox Grid.Column="12" Grid.Row="2" x:Name="txtUsername" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExampleUsername}" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}">
                <TextBox.Style>
                    <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBox}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Version}" Value="v3">
                                <Setter Property="Visibility" Value="Visible" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBox.Style>
                <TextBox.Text>
                    <Binding Path="Username" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                        <Binding.ValidationRules>
                            <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Column="0" Grid.Row="3" Text="{DynamicResource String_Auth}" Margin="0,10,0,0">
                <TextBlock.Style>
                    <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource CenterTextBlock}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding Version}" Value="v3" />
                                    <Condition Binding="{Binding Security}" Value="AuthNoPriv" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.Setters>
                                    <Setter Property="Visibility" Value="Visible" />
                                </MultiDataTrigger.Setters>
                            </MultiDataTrigger>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding Version}" Value="v3" />
                                    <Condition Binding="{Binding Security}" Value="AuthPriv" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.Setters>
                                    <Setter Property="Visibility" Value="Visible" />
                                </MultiDataTrigger.Setters>
                            </MultiDataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
            <ComboBox Grid.Column="2" Grid.Row="3" Height="{Binding ElementName=btnQuery, Path=ActualHeight}" ItemsSource="{Binding AuthenticationProviders}" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}" SelectedItem="{Binding AuthenticationProvider}" Margin="0,10,0,0">
                <ComboBox.Style>
                    <Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource DefaultComboBox}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding Version}" Value="v3" />
                                    <Condition Binding="{Binding Security}" Value="AuthNoPriv" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.Setters>
                                    <Setter Property="Visibility" Value="Visible" />
                                </MultiDataTrigger.Setters>
                            </MultiDataTrigger>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding Version}" Value="v3" />
                                    <Condition Binding="{Binding Security}" Value="AuthPriv" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.Setters>
                                    <Setter Property="Visibility" Value="Visible" />
                                </MultiDataTrigger.Setters>
                            </MultiDataTrigger>
                        </Style.Triggers>
                    </Style>
                </ComboBox.Style>
            </ComboBox>
            <TextBox Grid.Column="4" Grid.Row="3" Name="txtAuth" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}" Margin="0,10,0,0">
                <TextBox.Style>
                    <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBox}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding Version}" Value="v3" />
                                    <Condition Binding="{Binding Security}" Value="AuthNoPriv" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.Setters>
                                    <Setter Property="Visibility" Value="Visible" />
                                </MultiDataTrigger.Setters>
                            </MultiDataTrigger>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding Version}" Value="v3" />
                                    <Condition Binding="{Binding Security}" Value="AuthPriv" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.Setters>
                                    <Setter Property="Visibility" Value="Visible" />
                                </MultiDataTrigger.Setters>
                            </MultiDataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBox.Style>
                <TextBox.Text>
                    <Binding Path="Auth" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                        <Binding.ValidationRules>
                            <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Column="6" Grid.Row="3" Text="{DynamicResource String_Priv}" Margin="0,10,0,0">
                <TextBlock.Style>
                    <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource CenterTextBlock}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding Version}" Value="v3" />
                                    <Condition Binding="{Binding Security}" Value="AuthPriv" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.Setters>
                                    <Setter Property="Visibility" Value="Visible" />
                                </MultiDataTrigger.Setters>
                            </MultiDataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
            <ComboBox Grid.Column="8" Grid.Row="3" ItemsSource="{Binding PrivacyProviders}" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}" SelectedItem="{Binding PrivacyProvider}" Margin="0,10,0,0">
                <ComboBox.Style>
                    <Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource DefaultComboBox}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding Version}" Value="v3" />
                                    <Condition Binding="{Binding Security}" Value="AuthPriv" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.Setters>
                                    <Setter Property="Visibility" Value="Visible" />
                                </MultiDataTrigger.Setters>
                            </MultiDataTrigger>
                        </Style.Triggers>
                    </Style>
                </ComboBox.Style>
            </ComboBox>
            <TextBox Grid.Column="10" Grid.ColumnSpan="3" Grid.Row="3" Name="txtPriv" IsEnabled="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}" Margin="0,10,0,0">
                <TextBox.Style>
                    <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBox}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding Version}" Value="v3" />
                                    <Condition Binding="{Binding Security}" Value="AuthPriv" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.Setters>
                                    <Setter Property="Visibility" Value="Visible" />
                                </MultiDataTrigger.Setters>
                            </MultiDataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBox.Style>
                <TextBox.Text>
                    <Binding Path="Priv" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                        <Binding.ValidationRules>
                            <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                            <Validator:PrivacyAESValidator ValidatesOnTargetUpdated="True" />
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
        </Grid>
        <Button x:Name="btnQuery" Grid.Column="2" Command="{Binding WorkCommand}" IsDefault="{Binding IsWorking, Converter={StaticResource BooleanReverseConverter}}" IsCancel="{Binding IsWorking}" VerticalAlignment="Bottom">
            <Button.Resources>
                <Style TargetType="{x:Type Button}" BasedOn="{StaticResource ImageWithTextButton}">
                    <Setter Property="IsDefault" Value="False" />
                    <Setter Property="IsCancel" Value="False" />
                    <Setter Property="IsEnabled" Value="False" />
                    <Setter Property="Grid.Row" Value="1" />
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Mode}" Value="Set">
                            <Setter Property="Grid.Row" Value="5" />
                        </DataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Version}" Value="v1" />
                                <Condition Binding="{Binding ElementName=cbHost, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=cbOID, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=txtCommunity, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding IsWorking}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter Property="IsEnabled" Value="True" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Version}" Value="v2c" />
                                <Condition Binding="{Binding ElementName=cbHost, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=cbOID, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=txtCommunity, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding IsWorking}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter Property="IsEnabled" Value="True" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Version}" Value="v3" />
                                <Condition Binding="{Binding Security}" Value="noAuthNoPriv" />
                                <Condition Binding="{Binding ElementName=cbHost, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=cbOID, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=txtUsername, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding IsWorking}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter Property="IsEnabled" Value="True" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Version}" Value="v3" />
                                <Condition Binding="{Binding Security}" Value="AuthNoPriv" />
                                <Condition Binding="{Binding ElementName=cbHost, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=cbOID, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=txtUsername, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=txtAuth, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding IsWorking}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter Property="IsEnabled" Value="True" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Version}" Value="v3" />
                                <Condition Binding="{Binding Security}" Value="AuthPriv" />
                                <Condition Binding="{Binding ElementName=cbHost, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=cbOID, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=txtUsername, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=txtAuth, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding ElementName=txtPriv, Path=(Validation.HasError)}" Value="False" />
                                <Condition Binding="{Binding IsWorking}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter Property="IsEnabled" Value="True" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>
                        <DataTrigger Binding="{Binding IsWorking}" Value="True">
                            <Setter Property="IsEnabled" Value="False" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Button.Resources>
            <Button.Content>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Rectangle Width="20" Height="20" Margin="10,5,0,5">
                        <Rectangle.Resources>
                            <VisualBrush x:Key="VisualControlPlay" Stretch="Uniform" Visual="{IconPacks:Material Kind=Play}"/>
                            <VisualBrush x:Key="VisualClose" Stretch="Uniform" Visual="{IconPacks:Material Kind=Close}" />
                        </Rectangle.Resources>
                        <Rectangle.Style>
                            <Style TargetType="{x:Type Rectangle}">
                                <Setter Property="OpacityMask" Value="{StaticResource VisualControlPlay}" />
                                <Setter Property="Fill" Value="{DynamicResource GrayBrush3}" />
                            </Style>
                        </Rectangle.Style>
                    </Rectangle>
                    <TextBlock Grid.Column="1" Margin="10,5" TextAlignment="Center">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Text" Value="{DynamicResource String_Button_Query}"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Mode}" Value="Set">
                                        <Setter Property="Text" Value="{DynamicResource String_Button_Send}" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                </Grid>
            </Button.Content>
        </Button>
        <Controls:MetroProgressBar Grid.ColumnSpan="3" Foreground="{DynamicResource AccentColorBrush}" IsIndeterminate="True" Margin="0,10,0,0">
            <Controls:MetroProgressBar.Style>
                <Style TargetType="{x:Type Controls:MetroProgressBar}" >
                    <Setter Property="Visibility" Value="Collapsed" />
                    <Setter Property="Grid.Row" Value="2" />
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding IsWorking}" Value="True">
                            <Setter Property="Visibility" Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Mode}" Value="Set">
                            <Setter Property="Grid.Row" Value="6" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Mode}" Value="Trap">
                            <Setter Property="Grid.Row" Value="6" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Controls:MetroProgressBar.Style>
        </Controls:MetroProgressBar>
        <TextBlock Grid.ColumnSpan="3" Foreground="{DynamicResource AccentColorBrush}" Text="{Binding StatusMessage}" Margin="0,10,0,0" >
            <TextBlock.Style>
                <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource DefaultTextBlock}">
                    <Setter Property="Visibility" Value="Collapsed" />
                    <Setter Property="Grid.Row" Value="2" />
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding DisplayStatusMessage}" Value="True">
                            <Setter Property="Visibility" Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Mode}" Value="Set">
                            <Setter Property="Grid.Row" Value="6" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Mode}" Value="Trap">
                            <Setter Property="Grid.Row" Value="6" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TextBlock.Style>
        </TextBlock>
        <TextBlock Grid.Row="4" Grid.ColumnSpan="3">
            <TextBlock.Style>
                <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource HeaderTextBlock}">
                    <Setter Property="Text" Value="{DynamicResource String_Header_Result}" />
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Mode}" Value="Set">
                            <Setter Property="Text" Value="{DynamicResource String_Header_Data}" />
                            <Setter Property="Grid.ColumnSpan" Value="1"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Mode}" Value="Trap">
                            <Setter Property="Text" Value="{DynamicResource String_Header_Data}" />
                            <Setter Property="Grid.ColumnSpan" Value="1"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TextBlock.Style>
        </TextBlock>
        <DataGrid Grid.Row="5" Grid.ColumnSpan="3" ItemsSource="{Binding QueryResultView}" SelectedItem="{Binding SelectedQueryResult}">
            <DataGrid.Resources>
                <Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource DataGridScrollBar}" />
                <ContextMenu x:Key="RowContextMenu" Opened="ContextMenu_Opened" MinWidth="150">
                    <MenuItem Header="{DynamicResource String_CopyDots}">
                        <MenuItem.Icon>
                            <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}">
                                <Rectangle.OpacityMask>
                                    <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" />
                                </Rectangle.OpacityMask>
                            </Rectangle>
                        </MenuItem.Icon>
                        <MenuItem Header="{DynamicResource String_OID}" Command="{Binding CopySelectedOIDCommand}">
                            <MenuItem.Icon>
                                <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}">
                                    <Rectangle.OpacityMask>
                                        <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" />
                                    </Rectangle.OpacityMask>
                                </Rectangle>
                            </MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="{DynamicResource String_Data}" Command="{Binding CopySelectedDataCommand}">
                            <MenuItem.Icon>
                                <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}">
                                    <Rectangle.OpacityMask>
                                        <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" />
                                    </Rectangle.OpacityMask>
                                </Rectangle>
                            </MenuItem.Icon>
                        </MenuItem>
                    </MenuItem>
                </ContextMenu>
            </DataGrid.Resources>
            <DataGrid.Style>
                <Style TargetType="{x:Type DataGrid}" BasedOn="{StaticResource DefaultDataGrid}">
                    <Setter Property="Visibility" Value="Collapsed" />
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Mode}" Value="Get">
                            <Setter Property="Visibility" Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Mode}" Value="Walk">
                            <Setter Property="Visibility" Value="Visible" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </DataGrid.Style>
            <DataGrid.RowStyle>
                <Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource MetroDataGridRow}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding SelectedItems.Count, RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type DataGrid}}}" Value="1" >
                            <Setter Property="ContextMenu" Value="{StaticResource RowContextMenu}"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </DataGrid.RowStyle>
            <DataGrid.Columns>
                <DataGridTextColumn Header="{DynamicResource String_OID}" Binding="{Binding OID}" MinWidth="200" />
                <DataGridTextColumn Header="{DynamicResource String_Data}" Binding="{Binding Data}" MinWidth="300" Width="*" />
            </DataGrid.Columns>
        </DataGrid>
        <TextBox Grid.Row="5" Text="{Binding Data}">
            <TextBox.Style>
                <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource ConsoleTextBox}">
                    <Setter Property="Visibility" Value="Collapsed" />
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Mode}" Value="Set">
                            <Setter Property="Visibility" Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Mode}" Value="Trap">
                            <Setter Property="Visibility" Value="Visible" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TextBox.Style>
        </TextBox>
        <Expander Grid.Row="7" Grid.ColumnSpan="3" IsExpanded="{Binding ExpandStatistics}" Visibility="{Binding ShowStatistics, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource HeaderExpander}" Margin="0,20,0,0">
            <Expander.Header>
                <TextBlock Text="{DynamicResource String_Header_Statistics}" Style="{StaticResource HeaderTextBlock}" Margin="0" />
            </Expander.Header>
            <StackPanel>
                <Grid Margin="0,10,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="10" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Grid.Resources>
                        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource CenterTextBlock}" />
                        <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource TextBlockAsTextBox}">
                            <Setter Property="VerticalAlignment" Value="Center" />
                            <Setter Property="ContextMenu" Value="{StaticResource CopyContextMenu}" />
                            <Setter Property="TextWrapping" Value="NoWrap" />
                        </Style>
                    </Grid.Resources>
                    <TextBlock Grid.Column="0" Grid.Row="0" Text="{DynamicResource String_StartTime}" />
                    <TextBox Grid.Column="1" Grid.Row="0" Text="{Binding StartTime, Converter={StaticResource NullableDateTimeToStringConverter}}" />
                    <TextBlock Grid.Column="0" Grid.Row="1" Text="{DynamicResource String_Duration}" />
                    <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Duration, StringFormat={}{0:hh}h {0:mm}m {0:ss}s {0:ff}ms}" />
                    <TextBlock Grid.Column="0" Grid.Row="2" Text="{DynamicResource String_EndTime}" />
                    <TextBox Grid.Column="1" Grid.Row="2" Text="{Binding EndTime, Converter={StaticResource NullableDateTimeToStringConverter}}" />
                    <TextBlock Grid.Column="3" Grid.Row="0" Text="{DynamicResource String_Responses}">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource CenterTextBlock}">
                                <Setter Property="Visibility" Value="Visible" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Mode}" Value="Set">
                                        <Setter Property="Visibility" Value="Hidden" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Mode}" Value="Trap">
                                        <Setter Property="Visibility" Value="Hidden" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <TextBox Grid.Column="4" Grid.Row="0" Text="{Binding Responses, Converter={StaticResource IntToStringConverter}}">
                        <TextBox.Style>
                            <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource TextBlockAsTextBox}">
                                <Setter Property="Visibility" Value="Visible" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Mode}" Value="Set">
                                        <Setter Property="Visibility" Value="Hidden" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Mode}" Value="Trap">
                                        <Setter Property="Visibility" Value="Hidden" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBox.Style>
                    </TextBox>
                </Grid>
            </StackPanel>
        </Expander>
    </Grid>
</UserControl>
