<UserControl x:Class="RadGridView_SL4_AR_14.MainPage"
             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:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
             xmlns:my="clr-namespace:RadGridView_SL4_AR_14"
             mc:Ignorable="d" d:DesignHeight="700" d:DesignWidth="700">
    <UserControl.Resources>
        <my:MyViewModel x:Key="MyViewModel"/>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" 
          Background="White" 
          DataContext="{StaticResource MyViewModel}">
        <StackPanel Orientation="Vertical" Margin="0">
            <StackPanel Orientation="Horizontal" Margin="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="spDisplay" >

                <TextBlock Name="txtMaxVisitsNumberMsg" Foreground="Black" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20,0,0,0" />
                <TextBlock Name="txtMaxVisitsMsg" Visibility="Collapsed" Foreground="Red" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="15,0,0,0" />
            </StackPanel>
            <sdk:DataGrid Name="playersGrid" 
                                     ItemsSource="{Binding Players}" 
                                     AutoGenerateColumns="False"  MaxHeight="300" MaxWidth="700"
                             IsReadOnly="False"  FrozenColumnCount="1"
                              CanUserResizeColumns="True" VerticalAlignment="Top" 
                             CanUserSortColumns="False"  CanUserReorderColumns="False">
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTextColumn Binding="{Binding Name}"/>
                    <sdk:DataGridTextColumn Binding="{Binding Number}"/>
                    <sdk:DataGridTextColumn Binding="{Binding Position}"/>
                    <sdk:DataGridTextColumn Binding="{Binding Country}"/>
                    <sdk:DataGridTemplateColumn Header="ausschl.">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding IsChampion, Mode=TwoWay}" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged" />
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                </sdk:DataGrid.Columns>
            </sdk:DataGrid>
        </StackPanel>
    </Grid>
</UserControl>
