<?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_configuration_menu.xaml"
    >
  <Include.Resources>

    <!-- Header -->
    <ResourceWrapper x:Key="Header_Text" Resource="[SharesConfig.RemoveShares]"/>

    <!-- Shares configuration model -->
    <Model x:Key="Model" Id="1768FC91-86B9-4f78-8A4C-E204F0D51502"/>

    <!-- Contents -->
    <ControlTemplate x:Key="Contents_Template">
      <Grid DataContext="{Binding Source={StaticResource Model}}"
          HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10">
        <Grid.RowDefinitions>
          <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Label Grid.Row="0" Grid.Column="0" IsVisible="{Binding !AnyShareAvailable}"
            HorizontalAlignment="Center" VerticalAlignment="Center"
            Content="[SharesConfig.NoSharesAvailable]" Color="{ThemeResource TextColor}"/>
        <Grid Grid.Row="0" Grid.Column="0" IsVisible="{Binding AnyShareAvailable}"
            HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
          </Grid.ColumnDefinitions>
          <Label Grid.Row="0" Content="[SharesConfig.ChooseSharesToBeRemoved]" Color="{ThemeResource TextColor}" Wrap="True"/>
          <UniformGrid Grid.Row="1" Columns="1">
            <Grid x:Name="GlobalSharesPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                IsVisible="{Binding IsHomeServerConnected}" Margin="0,0,0,10">
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Label Margin="10" Grid.Row="0" Grid.Column="0" Content="[SharesConfig.GlobalShares]" Color="{ThemeResource TextColor}"/>
              <ListView Margin="10" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                  Style="{ThemeResource MultiMarkableSharesListViewStyle}"
                  ItemsSource="{Binding Path=ServerSharesList,Mode=OneTime}"/>
            </Grid>
            <Grid x:Name="LocalSharesPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                IsVisible="{Binding ShowLocalShares}" Margin="0,0,0,10">
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Label Margin="10" Grid.Row="0" Grid.Column="0" Content="[SharesConfig.LocalShares]" Color="{ThemeResource TextColor}"/>
              <ListView Margin="10" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                  Style="{ThemeResource MultiMarkableSharesListViewStyle}"
                  ItemsSource="{Binding Path=LocalSharesList,Mode=OneTime}"/>
            </Grid>
          </UniformGrid>
          <Grid Grid.Row="2" Margin="10,10,10,0">
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="10"/>
              <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="RemoveButton" Grid.Column="2" Style="{ThemeResource DialogButtonStyle}"
                Content="[System.Finish]" IsEnabled="{Binding IsSharesSelected}"
                Command="{Command Source={StaticResource Model},Path=RemoveSelectedSharesAndFinish}"/>
          </Grid>
        </Grid>
      </Grid>
    </ControlTemplate>

  </Include.Resources>
</Include>
