<UserControl x:Class="NETworkManager.Views.NetworkInterfaceView"
        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:Network="clr-namespace:NETworkManager.Models.Network"
        xmlns:IconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
        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:SettingsManager="clr-namespace:NETworkManager.Models.Settings"
        xmlns:Dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
        Dialog:DialogParticipation.Register="{Binding}"
        mc:Ignorable="d">
    <UserControl.InputBindings>
        <KeyBinding Key="F5" Command="{Binding ReloadNetworkInterfacesCommand}" />
    </UserControl.InputBindings>
    <UserControl.Resources>
        <Converter:BitsToHumanReadableSizeConverter x:Key="BitsToHumanReadableSizeConverter" />
        <Converter:BooleanReverseConverter x:Key="BooleanReverseConverter" />
        <Converter:BooleanReverseToVisibilityConverter x:Key="BooleanReverseToVisibilityConverter" />
        <Converter:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <Converter:IPAddressArrayToStringConverter x:Key="IPAddressArrayToStringConverter" />
        <Converter:NullOrEmptyToBoolConverter x:Key="NullOrEmptyToBoolConverter" />
        <Converter:NullToFalseConverter x:Key="NullToFalseConverter" />
        <Converter:PhysicalAddressToStringConverter x:Key="PhysicalAddressToStringConverter" />
        <Converter:ValidateNetworkInterfaceConfigConverter x:Key="ValidateNetworkInterfaceConfigConverter" />
        <Converter:BooleanToStringConverter x:Key="BooleanToStringConverter" />
        <Converter:SelectedItemsToBoolConverter x:Key="SelectedItemsToBoolConverter" />
        <Style x:Key="ReloadAnimation" TargetType="Rectangle">
            <Setter Property="Height" Value="24" />
            <Setter Property="Image.RenderTransform">
                <Setter.Value>
                    <RotateTransform CenterX="12" CenterY="12" />
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.Angle" From="0" To="720" Duration="0:0:2" />
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <TabControl>
        <TabControl.Style>
            <Style TargetType="{x:Type TabControl}" BasedOn="{StaticResource DefaultTabControl}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowCurrentApplicationTitle}" Value="False">
                        <Setter Property="Margin" Value="0,-2,0,0" />
                    </DataTrigger>
                </Style.Triggers> 
            </Style>
        </TabControl.Style>
        <TabItem Header="{DynamicResource String_Header_Information}">
            <ScrollViewer Margin="10" Style="{StaticResource DefaultScrollViewer}">
                <Grid>
                    <Grid>
                        <Grid.Style>
                            <Style TargetType="{x:Type Grid}" >
                                <Setter Property="Visibility" Value="Visible" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding NetworkInterfaces.Count}" Value="0">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Grid.Style>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0" Margin="0,0,0,20">
                            <TextBlock Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_Header_Interface}" />
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <ComboBox Grid.Column="0" x:Name="cbNetworkInterfaceProfiles" Grid.Row="1" ItemsSource="{Binding NetworkInterfaces}" SelectedItem="{Binding SelectedNetworkInterface}">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Rectangle Width="24" Height="24">
                                                    <Rectangle.Resources>
                                                        <VisualBrush x:Key="VisualUp" Stretch="Uniform" Visual="{IconPacks:Modern Kind=Network}"/>
                                                        <VisualBrush x:Key="VisualDown" Stretch="Uniform" Visual="{IconPacks:Modern Kind=NetworkDisconnect}" />
                                                    </Rectangle.Resources>
                                                    <Rectangle.Style>
                                                        <Style TargetType="{x:Type Rectangle}">
                                                            <Setter Property="OpacityMask" Value="{StaticResource VisualDown}" />
                                                            <Setter Property="Fill" Value="{DynamicResource GrayBrush3}" />
                                                            <Style.Triggers>
                                                                <DataTrigger Binding="{Binding IsOperational}" Value="True">
                                                                    <Setter Property="OpacityMask" Value="{StaticResource VisualUp}" />
                                                                </DataTrigger>
                                                            </Style.Triggers>
                                                        </Style>
                                                    </Rectangle.Style>
                                                </Rectangle>
                                                <StackPanel Margin="10,0,0,0">
                                                    <TextBlock Text="{Binding Path=Name}" />
                                                    <TextBlock Text="{Binding Path=Description}" Foreground="{DynamicResource GrayBrush3}"/>
                                                </StackPanel>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                    <ComboBox.ItemContainerStyle>
                                        <Style TargetType="{x:Type ComboBoxItem}" BasedOn="{StaticResource MetroComboBoxItem}">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="ComboBoxItem">
                                                        <Grid Background="{TemplateBinding Background}" RenderOptions.ClearTypeHint="{TemplateBinding RenderOptions.ClearTypeHint}">
                                                            <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                                            <Grid Margin="{TemplateBinding BorderThickness}">
                                                                <ContentPresenter x:Name="contentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                                            </Grid>
                                                        </Grid>
                                                        <ControlTemplate.Triggers>
                                                            <Trigger Property="IsSelected" Value="True">
                                                                <Setter Property="Foreground" Value="{DynamicResource AccentSelectedColorBrush}" />
                                                                <Setter TargetName="Border" Property="Background" Value="{DynamicResource GrayBrush9}" />
                                                            </Trigger>
                                                            <MultiTrigger>
                                                                <MultiTrigger.Conditions>
                                                                    <Condition Property="IsSelected" Value="False" />
                                                                    <Condition Property="IsMouseOver" Value="True" />
                                                                </MultiTrigger.Conditions>
                                                                <Setter TargetName="Border" Property="Background" Value="{DynamicResource GrayBrush10}" />
                                                            </MultiTrigger>
                                                            <Trigger Property="IsEnabled" Value="False">
                                                                <Setter TargetName="contentPresenter" Property="Opacity" Value=".55" />
                                                            </Trigger>
                                                        </ControlTemplate.Triggers>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </ComboBox.ItemContainerStyle>
                                </ComboBox>
                                <Button Grid.Column="1" Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}" Height="{Binding ElementName=cbNetworkInterfaceProfiles, Path=ActualHeight}" Command="{Binding ReloadNetworkInterfacesCommand}" Style="{StaticResource CleanButton}" IsEnabled="{Binding IsNetworkInterfaceLoading, Converter={StaticResource BooleanReverseConverter}}" Margin="10,0,0,0">
                                    <Rectangle Width="24" Height="24">
                                        <Rectangle.OpacityMask>
                                            <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=Refresh}" />
                                        </Rectangle.OpacityMask>
                                        <Rectangle.Style>
                                            <Style TargetType="{x:Type Rectangle}" BasedOn="{StaticResource ReloadAnimation}">
                                                <Setter Property="Fill" Value="{DynamicResource GrayBrush3}" />
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsMouseOver}" Value="True">
                                                        <Setter Property="Fill" Value="{DynamicResource GrayBrush5}" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Rectangle.Style>
                                    </Rectangle>
                                </Button>
                            </Grid>
                        </StackPanel>
                        <TextBlock Grid.Row="2" Text="{DynamicResource String_Header_Details}">
                            <TextBlock.Style>
                                <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource HeaderTextBlock}">
                                    <Setter Property="Visibility" Value="Visible" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding NetworkInterfaces.Count}" Value="0">
                                            <Setter Property="Visibility" Value="Collapsed" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </TextBlock.Style>
                        </TextBlock>
                        <Grid Grid.Row="3">
                            <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>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="1*"/>
                                <ColumnDefinition Width="10"/>
                                <ColumnDefinition Width="2*"/>
                            </Grid.ColumnDefinitions>
                            <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" />
                                <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>
                            <GridSplitter Grid.Column="1" Grid.RowSpan="19" Background="Transparent" HorizontalAlignment="Stretch" Focusable="False" />
                            <TextBlock Grid.Column="0" Grid.Row="0" Text="{DynamicResource String_Name}" />
                            <TextBox Grid.Column="2" Grid.Row="0" Text="{Binding DetailsName}" />
                            <TextBlock Grid.Column="0" Grid.Row="1" Text="{DynamicResource String_Description}" />
                            <TextBox Grid.Column="2" Grid.Row="1" Text="{Binding DetailsDescription}" />
                            <TextBlock Grid.Column="0" Grid.Row="2" Text="{DynamicResource String_Type}" />
                            <TextBox Grid.Column="2" Grid.Row="2" Text="{Binding DetailsType}" />
                            <TextBlock Grid.Column="0" Grid.Row="3" Text="{DynamicResource String_PhysicalAddress}" />
                            <TextBox Grid.Column="2" Grid.Row="3" Text="{Binding DetailsPhysicalAddress, Converter={StaticResource PhysicalAddressToStringConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="4" Text="{DynamicResource String_Status}" />
                            <TextBox Grid.Column="2" Grid.Row="4" Text="{Binding DetailsStatus}" />
                            <TextBlock Grid.Column="0" Grid.Row="5" Text="{DynamicResource String_Speed}" />
                            <TextBox Grid.Column="2" Grid.Row="5" Text="{Binding DetailsSpeed, Converter={StaticResource BitsToHumanReadableSizeConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="6" Text="{DynamicResource String_IPv4Address}" />
                            <TextBox Grid.Column="2" Grid.Row="6" Text="{Binding DetailsIPv4Address, Converter={StaticResource IPAddressArrayToStringConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="7" Text="{DynamicResource String_Subnetmask}"  />
                            <TextBox Grid.Column="2" Grid.Row="7" Text="{Binding DetailsSubnetmask, Converter={StaticResource IPAddressArrayToStringConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="8" Text="{DynamicResource String_IPv4DefaultGateway}" />
                            <TextBox Grid.Column="2" Grid.Row="8" Text="{Binding DetailsIPv4Gateway, Converter={StaticResource IPAddressArrayToStringConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="9" Text="{DynamicResource String_DHCPEnabled}"  />
                            <TextBox Grid.Column="2" Grid.Row="9" Text="{Binding DetailsIPv4DhcpEnabled, Converter={StaticResource BooleanToStringConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="10" Text="{DynamicResource String_DHCPServer}"  />
                            <TextBox Grid.Column="2" Grid.Row="10" Text="{Binding DetailsIPv4DhcpServer, Converter={StaticResource IPAddressArrayToStringConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="11" Text="{DynamicResource String_DHCPLeaseObtained}"  />
                            <TextBox Grid.Column="2" Grid.Row="11" Text="{Binding DetailsDhcpLeaseObtained}" />
                            <TextBlock Grid.Column="0" Grid.Row="12" Text="{DynamicResource String_DHCPLeaseExpires}"  />
                            <TextBox Grid.Column="2" Grid.Row="12" Text="{Binding DetailsDhcpLeaseExpires}" />
                            <TextBlock Grid.Column="0" Grid.Row="13" Text="{DynamicResource String_IPv6AddressLinkLocal}"  />
                            <TextBox Grid.Column="2" Grid.Row="13" Text="{Binding DetailsIPv6AddressLinkLocal, Converter={StaticResource IPAddressArrayToStringConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="14" Text="{DynamicResource String_IPv6Address}" />
                            <TextBox Grid.Column="2" Grid.Row="14" Text="{Binding DetailsIPv6Address, Converter={StaticResource IPAddressArrayToStringConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="15" Text="{DynamicResource String_IPv6DefaultGateway}" />
                            <TextBox Grid.Column="2" Grid.Row="15" Text="{Binding DetailsIPv6Gateway , Converter={StaticResource IPAddressArrayToStringConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="16" Text="{DynamicResource String_DNSAutoconfiguration}" />
                            <TextBox Grid.Column="2" Grid.Row="16" Text="{Binding DetailsDNSAutoconfigurationEnabled, Converter={StaticResource BooleanToStringConverter}}" />
                            <TextBlock Grid.Column="0" Grid.Row="17" Text="{DynamicResource String_DNSSuffix}" />
                            <TextBox Grid.Column="2" Grid.Row="17" Text="{Binding DetailsDNSSuffix}" />
                            <TextBlock Grid.Column="0" Grid.Row="18" Text="{DynamicResource String_DNSServers}" />
                            <TextBox Grid.Column="2" Grid.Row="18" Text="{Binding DetailsDNSServer, Converter={StaticResource IPAddressArrayToStringConverter}}" />
                        </Grid>
                    </Grid>
                    <StackPanel VerticalAlignment="Center">
                        <StackPanel.Style>
                            <Style TargetType="{x:Type StackPanel}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding NetworkInterfaces.Count}" Value="0">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </StackPanel.Style>
                        <TextBlock Text="{DynamicResource String_NoEnabledNetworkAdaptersFound}" Style="{StaticResource MessageTextBlock}" Margin="0,0,0,10" />
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <Button Command="{Binding ReloadNetworkInterfacesCommand}">
                                <Button.Resources>
                                    <Style TargetType="{x:Type Button}" BasedOn="{StaticResource ImageWithTextButton}">
                                        <Setter Property="IsEnabled" Value="True" />
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding IsNetworkInterfaceLoading}" 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=Refresh}"/>
                                            </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" Text="{DynamicResource String_Button_Refresh}" />
                                    </Grid>
                                </Button.Content>
                            </Button>
                            <Button Content="{DynamicResource String_Button_NetworkConnections}" Command="{Binding OpenNetworkConnectionsCommand}" Style="{StaticResource DefaultButton}" Margin="10,0,0,0"/>
                        </StackPanel>
                    </StackPanel>
                </Grid>
            </ScrollViewer>
        </TabItem>
        <TabItem Header="{DynamicResource String_Header_Configure}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition MinWidth="40" Width="{Binding ProfileWidth, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" MaxWidth="350" />
                </Grid.ColumnDefinitions>
                <Grid Grid.Column="0" Margin="10">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="10" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <ScrollViewer Grid.Row="0" Style="{StaticResource DefaultScrollViewer}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <StackPanel Grid.Row="0" Margin="0,0,0,20">
                                <TextBlock Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_Header_Interface}" />
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <ComboBox Grid.Column="0" Grid.Row="0" ItemsSource="{Binding NetworkInterfaces}" SelectedItem="{Binding SelectedNetworkInterface}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <StackPanel Orientation="Horizontal">
                                                    <Rectangle Width="24" Height="24">
                                                        <Rectangle.Resources>
                                                            <VisualBrush x:Key="VisualUp" Stretch="Uniform" Visual="{IconPacks:Modern Kind=Network}"/>
                                                            <VisualBrush x:Key="VisualDown" Stretch="Uniform" Visual="{IconPacks:Modern Kind=NetworkDisconnect}" />
                                                        </Rectangle.Resources>
                                                        <Rectangle.Style>
                                                            <Style TargetType="{x:Type Rectangle}">
                                                                <Setter Property="OpacityMask" Value="{StaticResource VisualDown}" />
                                                                <Setter Property="Fill" Value="{DynamicResource GrayBrush3}" />
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding IsOperational}" Value="True">
                                                                        <Setter Property="OpacityMask" Value="{StaticResource VisualUp}" />
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Rectangle.Style>
                                                    </Rectangle>
                                                    <StackPanel Margin="10,0,0,0">
                                                        <TextBlock Text="{Binding Path=Name}" />
                                                        <TextBlock Text="{Binding Path=Description}" Foreground="{DynamicResource GrayBrush3}"/>
                                                    </StackPanel>
                                                </StackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>
                                        <ComboBox.ItemContainerStyle>
                                            <Style TargetType="{x:Type ComboBoxItem}" BasedOn="{StaticResource MetroComboBoxItem}">
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="ComboBoxItem">
                                                            <Grid Background="{TemplateBinding Background}" RenderOptions.ClearTypeHint="{TemplateBinding RenderOptions.ClearTypeHint}">
                                                                <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                                                <Grid Margin="{TemplateBinding BorderThickness}">
                                                                    <ContentPresenter x:Name="contentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                                                </Grid>
                                                            </Grid>
                                                            <ControlTemplate.Triggers>
                                                                <Trigger Property="IsSelected" Value="True">
                                                                    <Setter Property="Foreground" Value="{DynamicResource AccentSelectedColorBrush}" />
                                                                    <Setter TargetName="Border" Property="Background" Value="{DynamicResource GrayBrush9}" />
                                                                </Trigger>
                                                                <MultiTrigger>
                                                                    <MultiTrigger.Conditions>
                                                                        <Condition Property="IsSelected" Value="False" />
                                                                        <Condition Property="IsMouseOver" Value="True" />
                                                                    </MultiTrigger.Conditions>
                                                                    <Setter TargetName="Border" Property="Background" Value="{DynamicResource GrayBrush10}" />
                                                                </MultiTrigger>
                                                                <Trigger Property="IsEnabled" Value="False">
                                                                    <Setter TargetName="contentPresenter" Property="Opacity" Value=".55" />
                                                                </Trigger>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </ComboBox.ItemContainerStyle>
                                    </ComboBox>
                                    <Button Grid.Column="1" Grid.Row="0" Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}" Height="{Binding ElementName=cbNetworkInterfaceProfiles, Path=ActualHeight}" Command="{Binding ReloadNetworkInterfacesCommand}" Style="{StaticResource CleanButton}" IsEnabled="{Binding IsNetworkInterfaceLoading, Converter={StaticResource BooleanReverseConverter}}" Margin="10,0,0,0">
                                        <Rectangle Width="24" Height="24">
                                            <Rectangle.OpacityMask>
                                                <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=Refresh}" />
                                            </Rectangle.OpacityMask>
                                            <Rectangle.Style>
                                                <Style TargetType="{x:Type Rectangle}" BasedOn="{StaticResource ReloadAnimation}">
                                                    <Setter Property="Fill" Value="{DynamicResource GrayBrush3}" />
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsMouseOver}" Value="True">
                                                            <Setter Property="Fill" Value="{DynamicResource GrayBrush5}" />
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Rectangle.Style>
                                        </Rectangle>
                                    </Button>
                                    <TextBlock Grid.Column="0" Grid.Row="1" Foreground="{DynamicResource AccentColorBrush}" Text="{DynamicResource String_ConnectTheNetworkCardToConfigureIt}" Visibility="{Binding CanConfigure, Converter={StaticResource BooleanReverseToVisibilityConverter}}" Style="{DynamicResource DefaultTextBlock}" Margin="0,10,0,0" />
                                </Grid>
                            </StackPanel>
                            <TextBlock Grid.Row="1" Style="{StaticResource HeaderTextBlock}" Text="{DynamicResource String_Header_Configure}" />
                            <StackPanel Grid.Row="2">
                                <RadioButton x:Name="radioButtonConfigEnableDynamicIPAddress" GroupName="IPAddressConfig" IsChecked="{Binding ConfigEnableDynamicIPAddress}" Content="{DynamicResource String_ObtainAnIPAddressAutomatically}" Margin="0,0,0,10"/>
                                <RadioButton x:Name="radioButtonConfigEnableStaticIPAddress" GroupName="IPAddressConfig" IsChecked="{Binding ConfigEnableStaticIPAddress}" Content="{DynamicResource String_UseTheFollowingIPAddress}" Margin="0,0,0,10"/>
                                <GroupBox Width="420" HorizontalAlignment="Left" IsEnabled="{Binding ConfigEnableStaticIPAddress}" Style="{DynamicResource WithoutHeaderGroupBox}" Margin="25,0,0,10">
                                    <Grid>
                                        <Grid.Resources>
                                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource CenterTextBlock}">
                                                <Setter Property="Margin" Value="0,0,10,0" />
                                            </Style>
                                            <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBox}">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ConfigEnableStaticIPAddress}" Value="False">
                                                        <Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Grid.Resources>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="1*" />
                                            <ColumnDefinition Width="1*" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="10" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="10" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Column="0" Grid.Row="0" Style="{StaticResource CenterTextBlock}" Text="{DynamicResource String_IPv4Address}" />
                                        <TextBox x:Name="txtConfigIPAddress" Grid.Column="1" Grid.Row="0" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExampleIPv4Address}">
                                            <TextBox.Text>
                                                <Binding Path="ConfigIPAddress" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                                                    <Binding.ValidationRules>
                                                        <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                                                        <Validator:IPv4AddressValidator ValidatesOnTargetUpdated="True" />
                                                    </Binding.ValidationRules>
                                                </Binding>
                                            </TextBox.Text>
                                        </TextBox>
                                        <TextBlock Grid.Column="0" Grid.Row="2" Style="{StaticResource CenterTextBlock}" Text="{DynamicResource String_SubnetmaskOrCIDR}" />
                                        <ComboBox x:Name="cbConfigSubnetmaskOrCidr" Grid.Column="1" Grid.Row="2" Style="{StaticResource EditableComboBox}" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExampleIPv4SubnetmaskIPv4CIDR}" ItemsSource="{x:Static Network:Subnetmask.List}">
                                            <ComboBox.Text>
                                                <Binding Path="ConfigSubnetmaskOrCidr" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                                                    <Binding.ValidationRules>
                                                        <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                                                        <Validator:IPv4SubnetmaskOrCIDRValidator ValidatesOnTargetUpdated="True"/>
                                                    </Binding.ValidationRules>
                                                </Binding>
                                            </ComboBox.Text>
                                            <ComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <Grid>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="150" />
                                                            <ColumnDefinition Width="*" />
                                                        </Grid.ColumnDefinitions>
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="25" />
                                                        </Grid.RowDefinitions>
                                                        <TextBlock Grid.Column="0" VerticalAlignment="Center" Style="{StaticResource DefaultTextBlock}" FontFamily="Consolas" Text="{Binding Path=Subnetmask}" />
                                                        <TextBlock Grid.Column="1" VerticalAlignment="Center" Style="{StaticResource DefaultTextBlock}" Text="{Binding Path=CIDR,StringFormat=/{0}}" Foreground="{DynamicResource GrayBrush2}" />
                                                    </Grid>
                                                </DataTemplate>
                                            </ComboBox.ItemTemplate>
                                        </ComboBox>
                                        <TextBlock Grid.Column="0" Grid.Row="4" Style="{StaticResource CenterTextBlock}"  Text="{DynamicResource String_DefaultGateway}"  />
                                        <TextBox x:Name="txtConfigGateway" Grid.Column="1" Grid.Row="4" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExampleIPv4Gateway}">
                                            <TextBox.Text>
                                                <Binding Path="ConfigGateway" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                                                    <Binding.ValidationRules>
                                                        <Validator:EmptyOrIPv4AddressValidator ValidatesOnTargetUpdated="True" />
                                                    </Binding.ValidationRules>
                                                </Binding>
                                            </TextBox.Text>
                                        </TextBox>
                                    </Grid>
                                </GroupBox>
                                <RadioButton x:Name="radioButtonConfigEnableDynamicDNS" GroupName="DNSServerConfig" Content="{DynamicResource String_ObtainDNSServerAddressAutomatically}" IsChecked="{Binding ConfigEnableDynamicDNS}" FontSize="14"  Margin="0,0,0,10" IsEnabled="{Binding ConfigEnableDynamicIPAddress}" />
                                <RadioButton x:Name="radioButtonConfigEnableStaticDNS" GroupName="DNSServerConfig" Content="{DynamicResource String_UseTheFollowingDNSServerAddresses}" IsChecked="{Binding ConfigEnableStaticDNS}" FontSize="14" Margin="0,0,0,10"/>
                                <GroupBox Grid.Row="10" Width="420" HorizontalAlignment="Left" IsEnabled="{Binding ConfigEnableStaticDNS}" Style="{DynamicResource WithoutHeaderGroupBox}" Margin="25,0,0,0">
                                    <Grid>
                                        <Grid.Resources>
                                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource CenterTextBlock}">
                                                <Setter Property="Margin" Value="0,0,10,0" />
                                            </Style>
                                            <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBox}" >
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ConfigEnableStaticDNS}" Value="False">
                                                        <Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Grid.Resources>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="1*" />
                                            <ColumnDefinition Width="1*" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="10" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Column="0" Grid.Row="0" Style="{StaticResource CenterTextBlock}"  Text="{DynamicResource String_PrimaryDNSServer}"  />
                                        <TextBox x:Name="txtConfigPrimaryDNSServer" Grid.Column="1" Grid.Row="0" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExampleIPv4Gateway}" Validation.ErrorTemplate="{StaticResource DefaultErrorTemplate}">
                                            <TextBox.Text>
                                                <Binding Path="ConfigPrimaryDNSServer" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                                                    <Binding.ValidationRules>
                                                        <Validator:EmptyOrIPv4AddressValidator ValidatesOnTargetUpdated="True" />
                                                    </Binding.ValidationRules>
                                                </Binding>
                                            </TextBox.Text>
                                        </TextBox>
                                        <TextBlock Grid.Column="0" Grid.Row="2" Style="{StaticResource CenterTextBlock}"  Text="{DynamicResource String_SecondaryDNSServer}"  />
                                        <TextBox x:Name="txtConfigSecondaryDNSServer" Grid.Column="1" Grid.Row="2" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExampleIPv4DNSServer}" Validation.ErrorTemplate="{StaticResource DefaultErrorTemplate}">
                                            <TextBox.Text>
                                                <Binding Path="ConfigSecondaryDNSServer" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                                                    <Binding.ValidationRules>
                                                        <Validator:EmptyOrIPv4AddressValidator ValidatesOnTargetUpdated="True" />
                                                    </Binding.ValidationRules>
                                                </Binding>
                                            </TextBox.Text>
                                        </TextBox>
                                    </Grid>
                                </GroupBox>
                            </StackPanel>
                        </Grid>
                    </ScrollViewer>
                    <Controls:MetroProgressBar Grid.Row="2" Foreground="{DynamicResource AccentColorBrush}" IsIndeterminate="True" Margin="0,0,0,10">
                        <Controls:MetroProgressBar.Style>
                            <Style TargetType="{x:Type  Controls:MetroProgressBar}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsConfigurationRunning}" Value="True">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Controls:MetroProgressBar.Style>
                    </Controls:MetroProgressBar>
                    <TextBlock Grid.Row="3" Foreground="{DynamicResource AccentColorBrush}" Text="{Binding StatusMessage}" Visibility="{Binding DisplayStatusMessage, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{DynamicResource DefaultTextBlock}" Margin="0,0,0,10" />
                    <Grid Grid.Row="4">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" HorizontalAlignment="Left" Command="{Binding FlushDNSCacheCommand}" IsEnabled="{Binding IsConfigurationRunning, Converter={StaticResource BooleanReverseConverter}}" Style="{StaticResource ImageWithTextButton}">
                            <Button.Content>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Rectangle Width="20" Height="20" Margin="10,5,0,5" Fill="{DynamicResource GrayBrush3}">
                                        <Rectangle.OpacityMask>
                                            <VisualBrush Stretch="Uniform" Visual="{IconPacks:Modern Kind=ListDelete}" />
                                        </Rectangle.OpacityMask>
                                    </Rectangle>
                                    <TextBlock Grid.Column="1" Text="{DynamicResource String_Button_FlushDNSCache}" FontSize="14" Margin="10,5" TextAlignment="Center"/>
                                </Grid>
                            </Button.Content>
                        </Button>
                        <Button Grid.Column="1" Command="{Binding ApplyNetworkInterfaceConfigCommand}">
                            <Button.Content>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Rectangle Width="20" Height="20" Margin="10,5,0,5" Fill="{DynamicResource GrayBrush3}">
                                        <Rectangle.OpacityMask>
                                            <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentSave}" />
                                        </Rectangle.OpacityMask>
                                    </Rectangle>
                                    <TextBlock Grid.Column="1" Text="{DynamicResource String_Button_Apply}" FontSize="14" Margin="10,5" TextAlignment="Center"/>
                                </Grid>
                            </Button.Content>
                            <Button.Style>
                                <Style TargetType="{x:Type Button}" BasedOn="{StaticResource ImageWithTextButton}">
                                    <Style.Triggers>
                                        <DataTrigger Value="False">
                                            <DataTrigger.Binding>
                                                <MultiBinding Converter="{StaticResource ValidateNetworkInterfaceConfigConverter}">
                                                    <Binding Path="ConfigEnableDynamicIPAddress" />
                                                    <Binding Path="ConfigEnableStaticIPAddress" />
                                                    <Binding ElementName="txtConfigIPAddress" Path="(Validation.HasError)" />
                                                    <Binding ElementName="cbConfigSubnetmaskOrCidr" Path="(Validation.HasError)" />
                                                    <Binding ElementName="txtConfigGateway" Path="(Validation.HasError)" />
                                                    <Binding Path="ConfigEnableDynamicDNS" />
                                                    <Binding Path="ConfigEnableStaticDNS" />
                                                    <Binding ElementName="txtConfigPrimaryDNSServer" Path="(Validation.HasError)" />
                                                    <Binding ElementName="txtConfigSecondaryDNSServer" Path="(Validation.HasError)" />
                                                    <Binding Path="CanConfigure" />
                                                </MultiBinding>
                                            </DataTrigger.Binding>
                                            <Setter Property="IsEnabled" Value="False" />
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding IsConfigurationRunning}" Value="True">
                                            <Setter Property="IsEnabled" Value="False" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>
                        </Button>
                    </Grid>
                </Grid>
                <GridSplitter Grid.Column="1" Style="{StaticResource ProfileGridSplitter}" />
                <Expander Grid.Column="2" x:Name="expanderProfiles" Header="{DynamicResource String_Header_Profiles}" Style="{StaticResource RightExpander}" IsExpanded="{Binding ExpandProfileView}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="10" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="10" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <TextBox x:Name="txtSearch" Grid.Column="0" VerticalAlignment="Center" Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SearchTextBox}"/>
                        <ListBox Grid.Column="0" Grid.Row="2" x:Name="listBoxProfiles" ItemsSource="{Binding NetworkInterfaceProfiles}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedProfile}" Style="{StaticResource ProfileListBox}">
                            <ListBox.Resources>
                                <ContextMenu x:Key="ListBoxItemContextMenu" Opened="ContextMenu_Opened" MinWidth="150">
                                    <MenuItem Header="{DynamicResource String_Apply}" Command="{Binding ApplyProfileCommand}">
                                        <MenuItem.Icon>
                                            <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}">
                                                <Rectangle.OpacityMask>
                                                    <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentSave}" />
                                                </Rectangle.OpacityMask>
                                            </Rectangle>
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem Header="{DynamicResource String_Edit}" Command="{Binding EditProfileCommand}">
                                        <MenuItem.Icon>
                                            <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}">
                                                <Rectangle.OpacityMask>
                                                    <VisualBrush Stretch="Uniform" Visual="{IconPacks:Modern Kind=Edit}" />
                                                </Rectangle.OpacityMask>
                                            </Rectangle>
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem Header="{DynamicResource String_CopyAs}" Command="{Binding CopyAsProfileCommand}">
                                        <MenuItem.Icon>
                                            <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}">
                                                <Rectangle.OpacityMask>
                                                    <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentDuplicate}" />
                                                </Rectangle.OpacityMask>
                                            </Rectangle>
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem Header="{DynamicResource String_Delete}" Command="{Binding DeleteProfileCommand}">
                                        <MenuItem.Icon>
                                            <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}">
                                                <Rectangle.OpacityMask>
                                                    <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=Close}" />
                                                </Rectangle.OpacityMask>
                                            </Rectangle>
                                        </MenuItem.Icon>
                                    </MenuItem>
                                </ContextMenu>
                            </ListBox.Resources>
                            <ListBox.InputBindings>
                                <KeyBinding Command="{Binding EditProfileCommand}" Key="F2" />
                                <KeyBinding Command="{Binding DeleteProfileCommand}" Key="Delete" />
                            </ListBox.InputBindings>
                            <ListBox.GroupStyle>
                                <GroupStyle>
                                    <GroupStyle.ContainerStyle>
                                        <Style TargetType="{x:Type GroupItem}">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate>
                                                        <Expander IsExpanded="True" Style="{StaticResource DefaultExpander}">
                                                            <Expander.Header>
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="*" />
                                                                        <ColumnDefinition Width="Auto" />
                                                                    </Grid.ColumnDefinitions>
                                                                    <TextBlock Grid.Column="0" Text="{Binding Name}" Style="{DynamicResource DefaultTextBlock}"/>
                                                                    <Button Grid.Column="1" ToolTip="{DynamicResource String_EditGroup}" Command="{Binding DataContext.EditGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBox}}}" CommandParameter="{Binding Name}" Visibility="{Binding IsMouseOver, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Grid}}, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource CleanButton}">
                                                                        <Rectangle Width="16" Height="16">
                                                                            <Rectangle.OpacityMask>
                                                                                <VisualBrush Stretch="Uniform" Visual="{IconPacks:Modern Kind=Edit}" />
                                                                            </Rectangle.OpacityMask>
                                                                            <Rectangle.Style>
                                                                                <Style TargetType="{x:Type Rectangle}">
                                                                                    <Setter Property="Fill" Value="{DynamicResource GrayBrush3}" />
                                                                                    <Style.Triggers>
                                                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsMouseOver}" Value="True">
                                                                                            <Setter Property="Fill" Value="{DynamicResource GrayBrush5}" />
                                                                                        </DataTrigger>
                                                                                    </Style.Triggers>
                                                                                </Style>
                                                                            </Rectangle.Style>
                                                                        </Rectangle>
                                                                    </Button>
                                                                </Grid>
                                                            </Expander.Header>
                                                            <ItemsPresenter />
                                                        </Expander>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </GroupStyle.ContainerStyle>
                                </GroupStyle>
                            </ListBox.GroupStyle>
                            <ListBox.ItemContainerStyle>
                                <Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource MetroListBoxItem}">
                                    <Setter Property="ContextMenu" Value="{StaticResource ListBoxItemContextMenu}" />
                                </Style>
                            </ListBox.ItemContainerStyle>
                        </ListBox>
                        <Grid Grid.Row="2" VerticalAlignment="Center">
                            <Grid.Style>
                                <Style TargetType="{x:Type Grid}">
                                    <Setter Property="Visibility" Value="Collapsed" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding NetworkInterfaceProfiles.Count}" Value="0">
                                            <Setter Property="Visibility" Value="Visible" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Grid.Style>
                            <StackPanel>
                                <Button HorizontalAlignment="Center" Focusable="False" Margin="0,0,0,10">
                                    <Button.Style>
                                        <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CleanButton}">
                                            <Setter Property="Command" Value="{Binding AddProfileCommand}" />
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding Search, Converter={StaticResource NullOrEmptyToBoolConverter}}" Value="False">
                                                    <Setter Property="Command" Value="{Binding ClearSearchCommand}" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Button.Style>
                                    <Rectangle Width="20" Height="20">
                                        <Rectangle.Resources>
                                            <VisualBrush x:Key="VisualPlus" Stretch="Uniform" Visual="{IconPacks:Material Kind=Plus}"/>
                                            <VisualBrush x:Key="VisualClear" Stretch="Uniform" Visual="{IconPacks:Material Kind=FilterRemoveOutline}" />
                                        </Rectangle.Resources>
                                        <Rectangle.Style>
                                            <Style TargetType="{x:Type Rectangle}">
                                                <Setter Property="OpacityMask" Value="{StaticResource VisualPlus}" />
                                                <Setter Property="Fill" Value="{DynamicResource GrayBrush3}" />
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsMouseOver}" Value="True">
                                                        <Setter Property="Fill" Value="{DynamicResource GrayBrush5}" />
                                                    </DataTrigger>
                                                    <DataTrigger Binding="{Binding Search, Converter={StaticResource NullOrEmptyToBoolConverter}}" Value="False">
                                                        <Setter Property="OpacityMask" Value="{StaticResource VisualClear}" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Rectangle.Style>
                                    </Rectangle>
                                </Button>
                                <TextBlock>
                                    <TextBlock.Style>
                                        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource MessageTextBlock}">
                                            <Setter Property="Text" Value="{DynamicResource String_NoProfilesFoundCreateOne}" />
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding Search, Converter={StaticResource NullOrEmptyToBoolConverter}}" Value="False">
                                                    <Setter Property="Text" Value="{DynamicResource String_NothingFound}" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </TextBlock.Style>
                                </TextBlock>
                            </StackPanel>
                        </Grid>
                        <Button x:Name="btnAddProfile" Grid.Column="0" Grid.Row="4" Command="{Binding AddProfileCommand}" Style="{StaticResource ImageWithTextButton}">
                            <Button.Content>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Rectangle Width="20" Height="20" Margin="10,5,0,5" Fill="{DynamicResource GrayBrush3}">
                                        <Rectangle.OpacityMask>
                                            <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=Plus}" />
                                        </Rectangle.OpacityMask>
                                    </Rectangle>
                                    <TextBlock Grid.Column="1" Text="{DynamicResource String_Button_AddProfile}" FontSize="14" Margin="10,5" TextAlignment="Center"/>
                                </Grid>
                            </Button.Content>
                        </Button>
                    </Grid>
                </Expander>
            </Grid>
        </TabItem>
    </TabControl>
</UserControl>
