user3091014
user3091014

Reputation: 25

How to navigate image source to another xaml? c# windows store app

i want to navigate txtBox1.text and bg2.source to another xaml at the same time

i try to use this

private void button1_Click(object sender, RoutedEventArgs e)
{
    this.Frame.Navigate(typeof(MultiGame), bg2.Source);
    this.Frame.Navigate(typeof(MultiGame), txtBox1.text);
}

it doesnt work. I hope someone can help me!!!

Upvotes: 0

Views: 411

Answers (1)

zimmerrol
zimmerrol

Reputation: 4951

Of course this does not work. As you call the Navigate method multiple times the Page MultiGameis loaded 2 times with each one of the parameters. Why don`t you pack the two variables in one object array, and pass this to the navigate method? Like

this.Frame.Navigate(typeof(MultiGame),new object[] {bg2.Source, txtBox1.text});

In the MultiGame class you now have to watch to the PageNavigated event. The navigation data is now your array.

Upvotes: 1

Related Questions