In WP7, you can directly navigate to a page of the program from app. XAML. CS.

Source: Internet
Author: User

When I was building a small application today, I re-activated it from the tombstone. At this time, I checked whether there was data in the activity event. If there was data, I had to navigateProgramA page (such as page a) in ). At the beginning, we were preparing to use navigationservice. navigate (). However, in APP. XAML. CS, navigationservice is regarded as a class by default, so it won't work. I asked the brothers in the group to know that in APP. XAML. CS, the navigation is written as follows:

 If (Isolatedstoragesettings. applicationsettings. Contains ( "  A  " )) //  Determine whether the conditions are met  
{

Rootframe. navigated + = New System. Windows. Navigation. navigatedeventhandler (rootframe_navigated );
}

Void Rootframe_navigated ( Object Sender, system. Windows. Navigation. navigationeventargs E)
{
// What you need to do and navigate
Rootframe. navigate ( New Uri ( " /A. XAML " , Urikind. Relative ));
Rootframe. navigated-= rootframe_navigated;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.