c# - Passing Data from Page to Page for Windows Phone 8.1 -


I have only one question, but only for Windows Phone 8.1 (in opposition to Windows Phone 7). Here's the question:

I am looking for the best practice about how to pass data from page to second page.

Page AI has a button that stops on Page B. Page BI has 6 text boxes allowing the user to enter information. When a user is done, click the button that brings him back to page A.

I want to return that data to Page A.

I have suggested:

The XML class uses the API class to store documents and store in different storage properties, to store information in a query string As I pass, I am looking for the best practice. Is there anyone who is recommended by Microsoft or which is generally considered the best method?

Thanks

Runtime in WP8.1 - Silverlight

  • The first and perhaps easiest way is to use it - you want it to be string If it is a serialjable type:

      // Assume that you have a simple class: Public class passedData {public string name {get; Set; } Public int value {get; Set; }} // Then you navigate like this: the frame. Navigate (typef (page 1), new pasadata {name = "my name", value = 10}); // And in the goal page you withdraw information: to navigate protected override zero navigation (Navigation Event Event e) {PassedData data = e.Parameter passedData;  
  • You

  • end As you mentioned, you can save your data: local settings , local storage , local cache - in this case you It also needs to be sorted

    Note that you will also have to suspend / resume the app - so it will be useful to save your data when the application is suspended and loaded. when it started. You should remember that OnNavigatedTo is not being called at the start of the app.


    The above was about general navigation (forward). If you want to fill some data in the previous page, then you have a few options:

    • Pass the handler on the previous page, so that you can access the public variable / property from the current page,
    • Use a fixed variable / property - one singleton may
    • use files / settings again

      Note that two Once again, the loss of two methods is suspended after applying It might be better to save files, maybe it might be better to think that some more work and proper operation are required.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -