<?xml version="1.0" encoding="utf-8"?>
<Include
    xmlns="www.team-mediaportal.com/2008/mpf/directx"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Source="screens\master_dialog_bare.xaml"
    >
  <Include.Resources>
    <Model x:Key="ServerNetworkCredentialSetupModel" Id="62BFBA02-88F8-41A9-BD5A-FFD98799089B"/>

    <ResourceWrapper x:Key="Dialog_Header_Text" Resource="[Settings.ServerSettings.NetworkCredentials]"/>

    <!-- Contents -->
    <ControlTemplate x:Key="Contents_Template">
      <Grid DataContext="{Binding Source={StaticResource ServerNetworkCredentialSetupModel}}" MinHeight="250">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal" Grid.Row="0">
          <CheckBox x:Name="UseCredentials" Margin="5" Style="{ThemeResource DefaultCheckBoxStyle}"
              IsChecked="{Binding Path=UseCredentials,Mode=TwoWay}"
              Content="{Binding}" />
          <Label Content="[Settings.ServerSettings.UseCredentials]" Color="{StaticResource DialogHeaderColor}" Margin="5"/>
        </StackPanel>

          <Grid Grid.Row="1" Margin="10" IsVisible="{Binding Path=UseCredentials}">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto"/>
              <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Label Content="[Settings.ServerSettings.Username]" Color="{StaticResource DialogHeaderColor}" Margin="5" Grid.Row="0"/>
            <TextBox Text="{Binding Path=NetworkUserName,Mode=TwoWay}" Margin="5" Style="{ThemeResource DefaultTextBoxStyle}" Grid.Row="0" Grid.Column="1"/>

            <Label Content="[Settings.ServerSettings.Password]" Color="{StaticResource DialogHeaderColor}" Margin="5" Grid.Row="1"/>
            <TextBox Text="{Binding Path=NetworkPassword,Mode=TwoWay}" Margin="5" Style="{ThemeResource PasswordTextBoxStyle}" Grid.Row="1" Grid.Column="1"/>

          </Grid>
        
        <Button x:Name="Ok" Style="{ThemeResource DialogButtonStyle}" Content="[System.Ok]" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Bottom">
          <Button.Command>
            <CommandList x:Key="Menu_Command">
              <Command Source="{StaticResource ServerNetworkCredentialSetupModel}" Path="SaveSettings"/>
              <Command Source="{Service ScreenManager}" Path="CloseTopmostDialog"/>
            </CommandList>
          </Button.Command>
        </Button>
      </Grid>
    </ControlTemplate>
  </Include.Resources>
</Include>