Possible Duplicate:
How to pass the image value in one xaml page to another xaml page in windows phone 7?
Passing data from page to page
I think is not a duplicate, because I dont found answer for my question, I dont passing an image, I passing 2darray[3,3] values in Page2.
I am developing a Windows Phone 7 app. I have two pages (mainpage and page2). I wrote the code in the mainpage. I have a 2D array with values. How can I use this array in page2? Please give a step by step answer, I am a beginner.
You can use JSON to serialize your array. You can use JSON.net like I did. Remember that you cannot pass every string to your Uri – if it contains characters like ‘&’ your app will crash. That’s why you have to use Uri.UnescapeDataString.
This an example for 2D string array. If you need to pass complex objects it’s still possible to use JSON.net (see the documentation). Just remember to use Uri.UnescapeDataString after serialization.
Before you deserialize your array from JSON you have to unescape it (Uri.UnescapeDataString).
In your source page:
In the destination page: