Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7862093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:59:38+00:00 2026-06-02T22:59:38+00:00

My MainPage.xaml is a pivot page with 3 PivotItems. Currently it is loading all

  • 0

My MainPage.xaml is a pivot page with 3 PivotItems. Currently it is loading all of the necessary stuff for each of the PivotItems on the MainPage constructor. This is bad because it loads a lot of stuff that are not necessary.

Reading here and here suggests that I only load the first PivotItem and after it loads, load the rest of the items. Specifically :

Improve the performance of the pivot application by loading Pivot control content on-demand as opposed to loading everything at startup. One solution is to take the content from each PivotItem control and convert into UserControls. You can then subscribe to the LoadingPivotItem event on the root pivot control. Next, in the event handler, instantiate the proper UserControl and set it as the PivotItem content.

If I follow the suggestion:

private void OnLoadingPivotItem(object sender, PivotItemEventArgs e)
{
if (e.Item.Content != null)
{
    // Content loaded already
    return;
}

Pivot pivot = (Pivot)sender;

if (e.Item == pivot.Items[0])
{
    e.Item.Content = new Page1Control();
}
else if (e.Item == pivot.Items[1])
{
    e.Item.Content = new Page2Control();
}
else if (e.Item == pivot.Items[2])
{
    e.Item.Content = new Page3Control();
}
}

I should use create class PageXControl ? Should it inherit somehow from main-page class ?

How do i take the content from each PivotItem control and convert into UserControls ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:59:40+00:00Added an answer on June 2, 2026 at 10:59 pm

    You could create your own Pivot items, which would inherit from PivotItem. I have put together a sample, based on the default Pivot project in VS, which splits out the two Pivot items into their own classes :-

    http://www.smartmobiledevice.co.uk/projects/PivotItemUserControlSample.zip

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Pivot on MainPage.xaml ; how can I call this from another
I have a Page in Silverlight which is Navigated from the MainPage.xaml, called OpenPage.xaml,
in my silverlight for windows phone app, i've created this xaml in the mainpage
i have 2 page i need to navigate mainpage.xaml to login.page xaml but it
Hi how can i bind to this observablecollection (Mainpage.xaml.cs) public ObservableCollection tabs = new
In my MainPage.xaml , I created a Pivot Control: <controls:Pivot Title=Powder God Name=PivotControl> .
I've got a MainPage.xaml page a Detail.xaml page. I've passed variables to the Detail.xaml
I have this code in MainPage.xaml: <controls:PivotItem Header=first> <ListBox x:Name=MyListBox Margin=0,0,-12,0 ItemsSource={Binding ListBoxItem}> <ListBox.ItemTemplate>
In MainPage.xaml.cs (Silverlight Application) I can do something like this: StackPanel myStackPanel = new
On my MainPage is a pivot bound to a list of locations. Each location

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.