I am developing an application that has a dynamic number of PanoramaItems, now currently these are all added by binging a list of them to the Panorama by using its ‘ItemsSource’ property.
But the problem comes when I try to add things to the created PanoramaItems. Now, I can add a ListBox, and that works as expected, but I’d really like to add something I have a bit more control over (possibly some type of custom control).
Now, I’ve found a fair few places that show me how to do this by editing the MainPage.xaml, but since I don’t know how many of them I need I cant (I think) do it like that.
The problem is added to by the fact that the PanoramaItem class doesn’t have an ‘Items’ property, just a ‘Content’ one (which is what I think I need).
I think I need to define a .xaml/.cs file for the custom control and then somehow apply that to the PanoramaItem but I’m really not sure
I’m going to assume here that you’re using a MVVM framework here, so if not, I apologize.
Your correct in thinking that you’ll probably want to use a user control for the Pano Items. Once you’ve got that going here’s the new XAML code:
obviously this is simplified, but should get the idea across. In your control you can bind directly to objects contained within PanoViewModels.