<Window x:Class="ListBoxBinding_Sample1.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:ListBoxBinding_Sample1"
        mc:Ignorable="d"
        Title="ListBoxBinding_Sample1" Height="300" Width="450">
    <Window.Resources>
        <Style TargetType="Button">
            <Setter Property="Width" Value="100" />
            <Setter Property="Margin" Value="6" />
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="Margin" Value="3 6 6 3" />
            <Setter Property="Grid.Column" Value="1" />
        </Style>
        <Style TargetType="Label">
            <Setter Property="Foreground" Value="White" />
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
    </Window.Resources>
    <Window.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="Black" Offset="0"/>
            <GradientStop Color="White" Offset="1"/>
        </LinearGradientBrush>
    </Window.Background>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <ListBox Name="listbox1" Margin="5" />
            <Grid Grid.Column="1" DataContext="{Binding SelectedItem, ElementName=listbox1}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Label Grid.Row="0">Vorname:</Label>
                <Label Grid.Row="1">Zuname:</Label>
                <Label Grid.Row="2">Alter:</Label>
                <Label Grid.Row="3">Stadt:</Label>
                <TextBox Grid.Row="0" Text="{Binding FirstName}" />
                <TextBox Grid.Row="1" Text="{Binding LastName}" />
                <TextBox Grid.Row="2" Text="{Binding Age}" />
                <TextBox Grid.Row="3" Text="{Binding City}" />
            </Grid>
        </Grid>
        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <Button Name="btnAdd">Hinzufügen</Button>
            <Button Name="btnDelete">Löschen</Button>
        </StackPanel>
    </Grid>
</Window>

