tags:

views:

12

answers:

0

Hello: In the OnMeasureOverride of a custom Panel within measureOverride, I need to look at the contents of what the end user will have supplied via ItemTemplate...

But the ListBoxItem element (the Panel's Child) is ...empty. It's ContentPresenter has not yet been filled in with the ItemTemplate's contents.

The only solution I found was to invoke

listItemBox.Measure(new Size());

to force its creation.

But turns out that the Measure() takes a LOT of resources, and for a list of 1000 items, this adds up to....2 seconds extra time.

Considering that this measure pass is going to be repeated in just a moment, this time with a more appropriate Size(), I'd I'd like to hydrate the item, early, but without the overhead of the Measure pass.

Does anybody know how to do this?

Thank you.