This works great:
<ItemsControl ItemsSource="{Binding Persons}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=FirstName}"/>
<TextBlock Text="{Binding Path=LastName}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
But I want to use User Control instead of the stack panel with two TextBlocks, using something like:
<DataTemplate>
<jasControls:NameView/>
</DataTemplate>
But with this and a million other syntaxes, NameView does not show anything, but it works fine in a separate test outside the ItemsControl element with an explicitly set property (dependency) - for example.
<jasControls:NameView FName="{Binding Path=Person.FirstName}" />
, , "" ()? ? ? ItemsControl , . ListBox? , Person? ? , ?! - , .
- TIA
James Stewart