WPF ItemsPresenter

Sam of Simple Samples 5,516 Reputation points
2024-03-24T03:38:34.23+00:00

In the following XAML:

<Window.Resources>
	<ControlTemplate x:Key="ListTemplate">
		<Grid>
			<ItemsPresenter TextBlock.Foreground="Blue"/>
		</Grid>
	</ControlTemplate>
</Window.Resources>
<Grid>
	<ListBox Name="listCars" DisplayMemberPath="Model"
				Template="{StaticResource ListTemplate}"/>
</Grid>

I do not understand why the ItemsPresenter specifies a TextBlock. Where does the documentation explain that?

XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
767 questions
0 comments No comments
{count} votes