Aram Gevorgyan
Aram Gevorgyan

Reputation: 2205

How add pages to panoramaItem?

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

Upvotes: 1

Views: 413

Answers (2)

Michael S. Scherotter
Michael S. Scherotter

Reputation: 10785

  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.

Upvotes: 2

Barranger Ridler
Barranger Ridler

Reputation: 880

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.

Upvotes: 1

Related Questions