<Window x:Class="Zadatak1.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:Zadatak1" d:DataContext="{d:DesignInstance Type=local:Student}"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="650">
    <Grid>
        <TabControl>
            <TabItem Header="Pregledaj sve">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <DataGrid x:Name="ViewDataGrid" IsReadOnly="True" GridLinesVisibility="Horizontal"
                                     AutoGenerateColumns="False" Grid.ColumnSpan="2">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Ime" Binding="{Binding Path=Ime}"/>
                            <DataGridTextColumn Header="Prezime" Binding="{Binding Path=Prezime}"/>
                            <DataGridTextColumn Header="Broj indeksa" Binding="{Binding Path=BrojIndeksa}"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
            <TabItem Header="Dodaj novog">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="2*"/>
                        <ColumnDefinition Width="5*"/>
                        <ColumnDefinition Width="4*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="2*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="2*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="Ime :" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top"  TextWrapping="Wrap" Grid.ColumnSpan="2"/>
                    <TextBlock Text="Prezime :" Grid.Column="3" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
                    <TextBlock Text="Broj indeksa :" Grid.Column="3" Grid.Row="3" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
                    <TextBox x:Name="txtIme" Padding ="2" Grid.Row="1" Grid.Column="5" VerticalAlignment="Top"/>
                    <TextBox x:Name="txtPrezime" Padding ="2" Grid.Row="2" Grid.Column="5" VerticalAlignment="Top" Grid.RowSpan="2"/>
                    <TextBox x:Name="txtBrojIndeksa" Padding ="2" Grid.Column="5" Grid.Row="3" VerticalAlignment="Top" TextWrapping="Wrap"/>
                    <Button x:Name="btnDodaj" Click="btnDodaj_Click" HorizontalAlignment="Right" VerticalAlignment="Center" Width="100" Height="25" Content="Dodaj" Grid.Column="5"
Grid.Row="4"/>
                </Grid>
            </TabItem>
            <TabItem Header="Izmeni" VerticalAlignment="Top">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="2*"/>
                        <ColumnDefinition Width="4*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="2*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="2*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="Ime :" Grid.Row="1" Grid.Column="2" VerticalAlignment="Top" TextWrapping="Wrap" />
                    <TextBlock Text="Prezime :" Grid.Row="2" Grid.Column="2" VerticalAlignment="Top" TextWrapping="Wrap" />
                    <TextBlock Text="Broj indeksa :" Grid.Row="3" Grid.Column="2" VerticalAlignment="Top" TextWrapping="Wrap"/>
                    <TextBox x:Name="txtImeIzmena" Text="{Binding Ime}" Padding ="2" Grid.Row="1"  Grid.Column="3" VerticalAlignment="Top"/>
                    <TextBox x:Name="txtPrezimeIzmena" Text="{Binding Prezime}" Padding ="2" Grid.Row="2" Grid.Column="3" VerticalAlignment="Top" TextWrapping="Wrap"/>
                    <TextBox x:Name="txtBrojIndeksaIzmena" Text="{Binding BrojIndeksa}" Padding ="2" Grid.Row="3" Grid.Column="3" VerticalAlignment="Top" TextWrapping="Wrap"/>

                    <Button x:Name="btnIzmeni" Click="btnIzmeni_Click" HorizontalAlignment="Left" VerticalAlignment="Center" Width="100" Height="25" Content="Izmeni" Grid.Column="3"
                        Grid.Row="4"/>
                    <Button x:Name="btnObrisi" Click="btnObrisi_Click"
                         VerticalAlignment="Center" HorizontalAlignment="Right" Height="25" Content="Obrisi" Grid.Column="3" Grid.Row="4"
                         Width="100"/>
                    <ListBox x:Name="lbStudenti" SelectionChanged="lbStudenti_SelectionChanged"
                             Grid.RowSpan="6" >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding BrojIndeksa}"/>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>

            </TabItem>
        </TabControl>

    </Grid>
</Window>
