DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Microsoft Information Leaker 'Exiting the Game', But Not Without Spilling More Beans
  • HowTo: Store and Retrieve Images in a SQL CE Database on Windows Phone Mango
  • Using the TabControl on Windows Phone 7
  • Using the LongListSelector control on Windows Phone 7

Trending

  • Microsoft Azure Synapse Analytics: Scaling Hurdles and Limitations
  • AI, ML, and Data Science: Shaping the Future of Automation
  • Why Database Migrations Take Months and How to Speed Them Up
  • Build Your First AI Model in Python: A Beginner's Guide (1 of 3)

Another Way of Passing Values Between Windows Phone 7 Pages

By 
Jevgeni Tšaikin user avatar
Jevgeni Tšaikin
·
Updated Jul. 24, 22 · Interview
Likes (1)
Comment
Save
Tweet
Share
10.5K Views

Join the DZone community and get the full member experience.

Join For Free

A View of Different Pages

If you are a Windows 7 phone owner, you may have noticed that your phone has different pages that you can engage with. This is intentional, of course, and allows for users of this phone to get access to exactly the information that they want at any time. 

Developers look at this as somewhat of a challenge. They need to figure out how they can keep certain bits of information from page to page while transferring other bits, and it is all about what they think their users will need to see from page to page. 

We have to admit that nothing about this is easy. There are many people who simply won't have the bandwidth or ability to get it all done. That said, it can be very rewarding for some people as they pull off the seemingly impossible. There are a lot of ways to look at the work that creators on the Windows 7 phone do, but few can argue that there aren't some amazing things happening on the system. 

Another appropriate way for passing data from one page to another during the navigation is in setting up destination page properties (or variables) within the OnNavigatedFrom method of the source page.

OnNavigatedFrom method is called just before a page is no longer the active page in a frame. For example this method is called if you invoke NavigationService.Navigate method from a source page. Due to the fact that OnNavigatedFrom method accepts NavigationEventArgs as input parameter you have access to the destination page stored in Content property.

Sample

I have created two pages: Page1.xaml and Page2.xaml. Inside Page2 I have added a string property named Parameter. Inside Page1 (codebehind) I have overridden method OnNavigatedFrom for setting up Page2′s Parameter property.

protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
{
    Page2 page2Instance = e.Content as Page2;
    if (page2Instance != null)
    {
        page2Instance.Parameter = "value";
    }
}


Advantages

Probably one of advantages is that you don’t have to store values in a static context, but simply pass them from one page to another. That approach is great for a wizard when you have several pages in a row and you need to store only the final result after the wizard is completed.

Disadvantages

This approach cannot be applied to applications that can lose sensitive information during the suspend mode (Tombstoning), because when the system restores your application from suspend mode there is no way to call OnNavigatedFrom method to set destination page properties.

Changing the Default Home Page

The default home page that one has set on their Windows phone can be changed as necessary. Some people simply leave up the page that is already pre-set as the default when they get the phone out of the box, but not everyone wants to leave it on that. 

If there is a page that you are more likely to jump to in the first place, then you need to consider getting that set up as your homepage instead of leaving it as-is. There are plenty of people who make the choice to switch it up like this, and there is nothing wrong with making that same choice for yourself as well. 

Just make sure you know which page you want to get set up when you do so. 

Allow For Magnifying of the Page

Coders should be careful to make sure they allow users to work within the system to make alterations to the code that they have put out. This may mean allowing them to modify certain aspects of the page in order to make it more useful to them. For example, it might be necessary to magnify the page in order to better see the text that is present on the screen. 

It is a big deal for some users as they try to read everything that is typed out on the page. These are seemingly small things, but certain users will benefit greatly from the small modifications that they need to make in order to get everything just the way that they need it. 

Adding Some Shortcuts

There are shortcuts that can help people get where they need to go without your app more easily. This will save them some time as they work through the ways that they are ultimately going to use your app. It makes a big difference, and it may save them mere seconds, but that is precious time on the Internet. 

You need to make sure the shortcuts that you program into your app are done in such a way that makes sense for how it is supposed to operate. The shortcuts should help people get to the most important information within the app. Those shortcuts simply make it easier for people to get to the most important aspects of the app more quickly. 

There isn't exactly a science to how you create your shortcuts. Rather, you should review the areas in your app that people seem to travel to the most. Those are the hotspots that you absolutely want to have shortcuts ready to go to. 

People appreciate when the app developers behind their favorite apps have clearly examined their behavior and determined what they are most likely going to want out of the experience. When they see the shortcuts pop up that are obviously useful to them, they know that the developers have done their job properly. 

Create Real Value

Everything that you add into the code of your app should create real value for the users. What does this mean? It means that there shouldn't be any aspect of your app that doesn't add something interesting to what you are doing for the people. 

The more that you can add to the value that they get out of the app, the better. They are expecting you to really come through for them, and you need to show that you are listening. 

The information that you place into your app is meant to be used by people for various aspects of their day-to-day life. Are you actually coming through for them and creating something that will enhance their ability to get things done or not? 

If not, then you need to go back to the drawing board and make sure you are putting your efforts where they need to be put. You risk destroying the trust between yourself and the users of your app if you aren't going the extra mile to deliver something interesting to them. 

Keep Pages Simple

Finally, you should try to keep pages as simple as possible. You don't want to have too many distractions on your page because it will only deter people from using your service. The simpler the pages, the better they are for users. It is a fact that they like to keep things simple because it means that they can just get at the information that matters the most to them.

If you make things overly complicated or add in too many bells and whistles, many users are going to get lost in the page. Try to keep it simple and straightforward in order to make it the best possible experience for your users every time. That is all that there is to making an experience that works for everyone. 

Windows Phone

Published at DZone with permission of Jevgeni Tšaikin. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Microsoft Information Leaker 'Exiting the Game', But Not Without Spilling More Beans
  • HowTo: Store and Retrieve Images in a SQL CE Database on Windows Phone Mango
  • Using the TabControl on Windows Phone 7
  • Using the LongListSelector control on Windows Phone 7

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!