Passing state between pages?

后端 未结 2 1918
滥情空心
滥情空心 2021-01-22 09:59

I have a Silverlight Windows Phone 7 app with two pages. I want to pass some nontrivial state (an array or structs) between them. Do I have to follow a Web model where everythin

相关标签:
2条回答
  • 2021-01-22 10:09

    No you don't have to pass everything in a query string. Just pass an id and store the data non-trivial data in isolated storage between pages.

    There is a series of articles on how to to do this here

    0 讨论(0)
  • 2021-01-22 10:26

    You have a couple of options:

    1. Use the query string as you suggested. This makes sense from a web development perspective, but we aren't in a web development perspective.
    2. Use a static variable. This is probably the simplest. Just declare another class with a static property, and you can share data this way. The only concern with this approach is thread-safety.
    3. Use Isolated Storage.
    0 讨论(0)
提交回复
热议问题