<Page x:ConnectionId='1'
    x:Class="GolfComp.Views.TeamListPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:GolfComp.Views"
    xmlns:source="using:DataAccessLibrary.Models"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" 
    xmlns:telerikGrid="using:Telerik.UI.Xaml.Controls.Grid"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Page.Resources>
        <source:KlasseModel x:Key="Items"/>
    </Page.Resources>

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <RelativePanel>
            <CommandBar x:ConnectionId='2' x:Name="mainCommandBar" HorizontalAlignment="Stretch"                                      >
                <AppBarButton x:ConnectionId='11'
                                            
                    Icon="Add"
                    Label="New"
                    ToolTipService.ToolTip="New record"/>
                <AppBarButton x:ConnectionId='12'
                                        
                    Icon="Delete"
                    Label="Delete"
                    ToolTipService.ToolTip="Delete record" />
                <AppBarButton x:ConnectionId='13'
                                              
                    Icon="Refresh"
                    Label="Update"
                    ToolTipService.ToolTip="Update record" />
            </CommandBar>
            <StackPanel x:ConnectionId='3'
                x:Name="newRecordStackPanel"
                Orientation="Horizontal"                
                RelativePanel.Below="mainCommandBar">
                <ComboBox x:ConnectionId='6' x:Name="golfclubDropDown" Header="Homeclub" Margin="8,8,16,8" MinWidth="150"/>
                <ComboBox x:ConnectionId='7' x:Name="klasseDropDown" Header="Competitie" Margin="8,8,16,8" MinWidth="150"/>
                <TextBox x:ConnectionId='8'
                    x:Name="TeamNaamTextBox"
                    Header="Teamnaam"
                    PlaceholderText="teamnaam"
                    Margin="8,8,16,8"/>
                <AppBarButton x:ConnectionId='9' x:Name="DeleteNewRecord"                               Icon="Cancel"/>
                <AppBarButton x:ConnectionId='10' x:Name="SaveNewRecord"                             Icon="Save"/>
            </StackPanel>
            <telerikGrid:RadDataGrid x:ConnectionId='4' 
                AutoGenerateColumns="False"
                x:Name="Datagrid" 
                BorderThickness="0" 
                ColumnDataOperationsMode="Flyout" 
                GridLinesVisibility="None"
                GroupPanelPosition="Left" 
                RelativePanel.AlignLeftWithPanel="True"
                RelativePanel.AlignRightWithPanel="True"
                RelativePanel.Below="newRecordStackPanel"
                UserEditMode="Inline"
                                                                 >
                <telerikGrid:RadDataGrid.Columns>
                    <telerikGrid:DataGridComboBoxColumn x:ConnectionId='5' PropertyName="Competitie" 
                                                        Header="Competitie"                                                         
                                                                                     
                                                        DisplayMemberPath="Competitie"
                                                        SelectedValuePath="Klasse_Id" 
                                                        />

                    <telerikGrid:DataGridNumericalColumn PropertyName="Speler1Id" Header="Speler 1"/>
                    <telerikGrid:DataGridNumericalColumn PropertyName="Speler2Id" Header="Speler 2"/>
                    <telerikGrid:DataGridNumericalColumn PropertyName="Speler3Id" Header="Speler 3" />
                    <telerikGrid:DataGridNumericalColumn PropertyName="Speler4Id" Header="Speler 4" />
                    <telerikGrid:DataGridNumericalColumn PropertyName="Speler5Id" Header="Speler 5" />
                    <telerikGrid:DataGridNumericalColumn PropertyName="Speler6Id" Header="Speler 6" />
                    <telerikGrid:DataGridTextColumn PropertyName="Naam" Header="Teamnaam" />
                </telerikGrid:RadDataGrid.Columns>
            </telerikGrid:RadDataGrid>
        </RelativePanel>
    </Grid>

</Page>

