How add pages to panoramaItem?

428 Views Asked by At

I want to have panorama control (or pivot ) that each PanoramaItem will be some MyPage.xaml. How can I do that ?

2

There are 2 best solutions below

3
On BEST ANSWER
  1. Create each page as a user control (MyPage.xaml)
  2. In your panorama or pivot control, add a pivotitem or panormaitem
  3. Replace the default grid child of each pivotItem or PanoramaItem with an instance of the page created in step 1.
1
On

You'll want to look at System.Windows.Markup.XamlReader

We've used it to set up a listbox like so:

ListBox lb = new ListBox();
lb.ItemTemplate = (DataTemplate)XamlReader.Load("XAML as a string here");

Not exactly what you want, but should be enough to get you going.