<Window x:Class="WPF_23_MVVMViewModels.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:viewModel="clr-namespace:WPF_23_MVVMViewModels.ViewModel"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="7*" />
                <ColumnDefinition Width="3*" />
            </Grid.ColumnDefinitions>
            <DataGrid Grid.Column="0" CanUserAddRows="False" CanUserDeleteRows="False"
                      ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}"
                      AutoGenerateColumns="False"
                      d:DataContext="{d:DesignInstance viewModel:MainWindowViewModel}">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="4*" />
                    <DataGridTextColumn Header="SerialNUmber" Binding="{Binding SerialNUmber}" Width="4*" />
                    <DataGridTextColumn Header="Quantity" Binding="{Binding Quantity}" Width="2*" />
                </DataGrid.Columns>
            </DataGrid>

            <StackPanel Grid.Column="1" d:DataContext="{d:DesignInstance viewModel:MainWindowViewModel}">
                <Label>Name</Label>
                <TextBox Margin="5 0 5 15" Text="{Binding SelectedItem.Name, UpdateSourceTrigger=PropertyChanged}" />
                <Label> Serial Number</Label>
                <TextBox Margin="5 0 5 15"
                         Text="{Binding SelectedItem.SerialNUmber, UpdateSourceTrigger=PropertyChanged}" />
                <Label>Quantity</Label>
                <TextBox Margin="5 0 5 15" Text="{Binding SelectedItem.Quantity, UpdateSourceTrigger=PropertyChanged}" />
            </StackPanel>
        </Grid>
    </Grid>
</Window>