How to pass more than one parameter on frame navigation in Metro Style Apps?
c#, windows-8
Solution
Create a new class with 2 properties and set the properties to the textblock values. Then you pass this object when you navigate.
Create the payload class:
public class Payload
{
public string text1 { get;set;}
public string text2 { get;set;}
}
Then populate the payload class:
Payload payload = new Payload();
payload.text1 = textblock1.Text;
payload.text2 = textblock2.Text;
Then when you call Navigate pass your instance of payload like this:
this.Frame.Navigate(typeof(SecondPage),payload);
Problem
I am building a Metro Style App for Win8 which requires to pass two textblock values on frame navigation. For one parameter, it works but for two parameters its not working. Please help! I have tried like the following: this.Frame.Navigate(typeof(SecondPage),textblock1.Text + textblock2.Text); I doesn't show any error but its not working.