<UserControl x:Class="NETworkManager.Views.RemoteDesktopSettingsView"
        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:mah="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:Converter="clr-namespace:NETworkManager.Converters"
        xmlns:Validator="clr-namespace:NETworkManager.Validators"
        mc:Ignorable="d">
    <UserControl.Resources>
        <Converter:BooleanReverseConverter x:Key="BooleanReverseConverter" />
    </UserControl.Resources>
    <StackPanel>
        <TextBlock Text="{DynamicResource String_Header_Display}" Style="{StaticResource HeaderTextBlock}" />
        <RadioButton x:Name="rbAdjustScreenAutomatically" Content="{DynamicResource String_AdjustScreenAutomatically}" IsChecked="{Binding AdjustScreenAutomatically}" Margin="0,0,0,10" />
        <RadioButton x:Name="rbUseCurrentViewSize" Content="{DynamicResource String_UseCurrentViewSize}" IsChecked="{Binding UseCurrentViewSize}" Margin="0,0,0,10" />
        <RadioButton x:Name="rbFixedScreenSize" Content="{DynamicResource String_FixedScreenSize}" IsChecked="{Binding UseFixedScreenSize}" Margin="0,0,0,10" />
        <GroupBox x:Name="gbFixedScreenSize" Style="{StaticResource WithoutHeaderGroupBox}" MinWidth="270" HorizontalAlignment="Left" IsEnabled="{Binding UseFixedScreenSize}" Margin="25,0,0,10">
            <StackPanel>
                <TextBlock Text="{DynamicResource String_SelectAScreenResolution}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />
                <ComboBox ItemsSource="{Binding ScreenResolutions}" SelectedItem="{Binding SelectedScreenResolution}" Width="250" HorizontalAlignment="Left" />
            </StackPanel>
        </GroupBox>
        <RadioButton x:Name="rbCustomScreenSize" Content="{DynamicResource String_CustomScreenSize}" IsChecked="{Binding UseCustomScreenSize}" Margin="0,0,0,10" />
        <GroupBox Style="{StaticResource WithoutHeaderGroupBox}" Width="{Binding ElementName=gbFixedScreenSize, Path=ActualWidth}" HorizontalAlignment="Left" IsEnabled="{Binding UseCustomScreenSize}" Margin="25,0,0,10">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="10" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="10" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <TextBlock Grid.Column="0" Grid.Row="0" Text="{DynamicResource String_Width}" Style="{StaticResource CenterTextBlock}" />
                <TextBox Grid.Column="2" Grid.Row="0">
                    <TextBox.Text>
                        <Binding Path="CustomScreenWidth" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                            <Binding.ValidationRules>
                                <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                                <Validator:Int32Validator ValidatesOnTargetUpdated="True" />
                            </Binding.ValidationRules>
                        </Binding>
                    </TextBox.Text>
                </TextBox>
                <TextBlock Grid.Column="0" Grid.Row="2" Text="{DynamicResource String_Height}" Style="{StaticResource CenterTextBlock}" />
                <TextBox Grid.Column="2" Grid.Row="2">
                    <TextBox.Text>
                        <Binding Path="CustomScreenHeight" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                            <Binding.ValidationRules>
                                <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                                <Validator:Int32Validator ValidatesOnTargetUpdated="True" />
                            </Binding.ValidationRules>
                        </Binding>
                    </TextBox.Text>
                </TextBox>
            </Grid>
        </GroupBox>
        <TextBlock Text="{DynamicResource String_ColorDepthBit}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />
        <ComboBox ItemsSource="{Binding ColorDepths}" SelectedItem="{Binding SelectedColorDepth}" Width="250" HorizontalAlignment="Left"  Margin="0,0,0,20" />
        <TextBlock Text="{DynamicResource String_Header_Network}" Style="{StaticResource HeaderTextBlock}" />
        <TextBlock Text="{DynamicResource String_Port}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />
        <TextBox Width="250" HorizontalAlignment="Left" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExamplePort3389 }" Style="{StaticResource DefaultTextBox}" Margin="0,0,0,20">
            <TextBox.Text>
                <Binding Path="Port" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                    <Binding.ValidationRules>
                        <Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
                        <Validator:PortValidator ValidatesOnTargetUpdated="True" />
                    </Binding.ValidationRules>
                </Binding>
            </TextBox.Text>
        </TextBox>
        <TextBlock Text="{DynamicResource String_Header_Authentication}" Style="{StaticResource HeaderTextBlock}" />
        <mah:ToggleSwitch Header="{DynamicResource String_CredentialSecuritySupportProvider}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding EnableCredSspSupport}" Margin="0,0,0,10" />
        <TextBlock Text="{DynamicResource String_AuthenticationLevel}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />
        <StackPanel Orientation="Horizontal" Margin="0,0,0,20">
            <mah:NumericUpDown Value="{Binding AuthenticationLevel}" Maximum="3" Minimum="0" Interval="1" />
            <Rectangle Width="24" Height="24" Grid.Column="3" Grid.Row="4" ToolTip="{Binding RDPAuthenticationLevelHelpMessage}" Style="{StaticResource HelpImageRectangle}" Margin="10,0,0,0">
                <Rectangle.Resources>
                    <Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource HelpToolTip}" />
                </Rectangle.Resources>
            </Rectangle>
        </StackPanel>
        <TextBlock Text="{DynamicResource String_Header_LocalDevicesAndResources}" Style="{StaticResource HeaderTextBlock}" />
        <mah:ToggleSwitch Header="{DynamicResource String_RedirectClipboard}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectClipboard}" Margin="0,0,0,10" />
        <mah:ToggleSwitch Header="{DynamicResource String_RedirectDevices}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectDevices}" Margin="0,0,0,10" />
        <mah:ToggleSwitch Header="{DynamicResource String_RedirectDrives}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectDrives}" Margin="0,0,0,10" />
        <mah:ToggleSwitch Header="{DynamicResource String_RedirectPorts}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectPorts}" Margin="0,0,0,10" />
        <mah:ToggleSwitch Header="{DynamicResource String_RedirectSmartcards}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectSmartCards}" Margin="0,0,0,10" />
        <mah:ToggleSwitch Header="{DynamicResource String_RedirectPrinters}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding RedirectPrinters}" />
    </StackPanel>
</UserControl>
