WinRT: how to set IsItemsHost in ItemsControl's Panel RRS feed

  • Question

  • I'm writing my custom radial panel and I also want to write specific ItemsControl, that would fully depend on this Panel. The reason why I want this is to prevent Panel from handling scrolling and other specific things and to make the custom ItemsControl do the magic. And because of this I didn't really want to specify the Panel in ItemsPanelTemplate, rather in the control template itself so that I could bind to Template properties and then in code behind get the panel to work with. But the problem is that I can't make the Panel be seen as ItemsHost. MSDN states that: IsItemsHost is a calculated property where the value results from the system checking the parents of the Panel for an ItemsControl implementation. If one exists, then the value is true.

    But in fact it doesn't, if I specify a Panel as a ControlTemplate element. As a result the RootPanel isn't what I need.

    I've already decided to actually put my panel in ItemsPanelTemplate, but I need then to bind some of the properties to the template ones, but I have no idea how to access those panel BEFORE items presenter actually starts to load elements.

    I would be very grateful for help.

    Wednesday, May 28, 2014 12:18 PM

All replies

  • You cannot set IsItemsHost. It is always calculated for Windows Store apps.

    I don't understand what you are trying to do here. Can you provide a clearer explanation? An architecture drawing and minimal sample code demonstrating the layout would be helpful as well.


    Thursday, May 29, 2014 12:37 AM