MicrosoftDocs / windows-dev-docs

Conceptual and overview content for developing Windows apps
Creative Commons Attribution 4.0 International
677 stars 1.19k forks source link

Please provide further explanation on how to handle ChoosingItemContainer #2354

Open jess-rod opened 4 years ago

jess-rod commented 4 years ago
  1. In your example, when and how are simpleFileItemTrees and specialFileItemTrees first created?
  2. The example shows how the element at position 0 is assigned to args.ItemContainer, but why always at position 0?
  3. Shouldn't the position be different depending on whether the element at that position is being used?
  4. Aren't those lists for recycling item containers?
  5. Otherwise, when or why should either simpleFileItemTrees or specialFileItemTrees be altered (have an item removed or altered)?

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

crackerland commented 4 years ago

I found that the sample also does not work unless you call args.IsContainerPrepared = true; after creating the new ListViewItem. If you don't do this the DataTemplate never loads and all you see is the default item, which is just a TextBox.