How can I get StackPanel to use an ItemTemplate? How can I get StackPanel to use an ItemTemplate? wpf wpf

How can I get StackPanel to use an ItemTemplate?


ItemsControl is essentially a StackPanel with an ItemTemplate. It uses a StackPanel internally.

However, it looks like you're trying to display a single customer rather than a list of them (I sound like Clippy, don't I?). In that case you want to use a ContentControl:

<ContentControl     Content="{Binding SelectedCustomer}"    ContentTemplate="{StaticResource CustomerTemplate}" />