Tsury
Tsury

Reputation: 739

WPF ContentPresenter bound to a collection

I have a collection of string.

I want to create an image out of each of the strings using a converter.

I tried binding the collection to a ContentPresenter, but I don't know what do to when binding to a collection since I don't know how many items are in the collection.

I don't want to put it in a container such as ListBox, I want the images to be in an existing Grid...

Thanks.

Upvotes: 2

Views: 2076

Answers (1)

gimalay
gimalay

Reputation: 493

Place images in ItemsControl and define ItemsPanel template to layout images as u like.

Read this article for details.

Upvotes: 2

Related Questions