<Window x:Class="R13_MVVM_Student.MainWindow"
        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:local="clr-namespace:R13_MVVM_Student"
        mc:Ignorable="d"
        Title="Student" Height="210" Width="300">
    <Window.DataContext>
        <local:StudentViewModel/>
    </Window.DataContext>
    <StackPanel>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Label Content="Imię:" Grid.Row="0" Grid.Column="0"/>
            <TextBox Text="{Binding Kursant.Imie}" Grid.Row="0" Grid.Column="1" Width = "120" Margin = "5"/>
            <Label Content="Nazwisko:" Grid.Row="1" Grid.Column="0"/>
            <TextBox Text="{Binding Kursant.Nazwisko}" Grid.Row="1" Grid.Column="1" Width = "120" Margin = "5"/>
            <Label Content="Rok rozpoczęcia studiów:" Grid.Row="2" Grid.Column="0"/>
            <TextBox Text="{Binding Kursant.RokPrzyjeciaNaStudia, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="1" Width = "120" Margin = "5"/>
            <Label Content="Ile lat studiuje:" Grid.Row="3" Grid.Column="0"/>
            <TextBlock Text="{Binding Kursant.CzasStudiowania, Mode = OneWay}" Grid.Row="3" Grid.Column="2" Width = "120" Margin = "5"/>
        </Grid>
        <Button Content="Wyczyść dane" Height="20" Width="100" VerticalAlignment="Bottom" 
                HorizontalAlignment="Right" Margin="20" Command="{Binding Wyczysc}"/>
    </StackPanel>
</Window>
