Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<catel:StackGrid>
    <catel:StackGrid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
    </catel:StackGrid.RowDefinitions>
    <catel:StackGrid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="*" />
    </catel:StackGrid.ColumnDefinitions>

    <Label Content="Family name" />
    <Label Content="{Binding FamilyName}" />

    <Label Grid.ColumnSpan="2" Content="Persons" />
        
    <ItemsControl Grid.ColumnSpan="2" ItemsSource="{Binding Persons}">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <views:PersonView DataContext="{Binding}" />
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</catel:StackGrid>

Since this view uses the PersonView, it must be defined as a namespace at the top of the file:

Code Block
xmlns:views="clr-namespace:WPF.GettingStarted.Views"

The thing that is important to notice in the FamilyView is how it uses the PersonView and injects the Person models into the PersonView data context.

...