0

I have the following code:

NavigationService.Navigate(new Uri("/Test.xaml?msg="+msg, UriKind.Relative));

Where my string msg is too large and I get an exception thrown saying that the URI is too long. Could anyone make any suggestions as to what I could do to get msg on my target page?

Thanks

LTKD
  • 214
  • 2
  • 13

1 Answers1

0

You could save the message in a global variable, fore example in App.xaml.cs, and then access it from the new page.

Anyway, I would recommend you to start using MVVM pattern in your apps. This will help you to better organize your code separating data and logic from UI, as well as offering mechanisms to deal with sharing data between pages.

anderZubi
  • 6,414
  • 5
  • 37
  • 67
  • I just want to make it known that I figured it out before anderZubi told me this. However this IS the correct answer and giving more reputation to someone else rather than making and accepting my own answer is better. Have a good day! – LTKD Jul 05 '13 at 13:37