0

When i try to declare NavigationContext i am getting error in Windows Phone 8.1

public static string GetFeedbackMailMessage(NavigationContext context)
{
    string VideoTitle = string.Empty;
    string LinkType = string.Empty;
    string VideoUrl = string.Empty;
    string ShowTitle = string.Empty;
    string FeedbackMessage = string.Empty;

    context.QueryString.TryGetValue("chno", out VideoTitle);
    context.QueryString.TryGetValue("LinkType", out LinkType);
    context.QueryString.TryGetValue("uri", out VideoUrl);
    context.QueryString.TryGetValue("title", out ShowTitle);
    if (context.QueryString.TryGetValue("chno", out VideoTitle) && context.QueryString.TryGetValue("LinkType", out LinkType) && context.QueryString.TryGetValue("uri", out VideoUrl) && context.QueryString.TryGetValue("title", out ShowTitle))
    {
        FeedbackMessage = "Movie Name : " + ShowTitle + "\n" + VideoTitle + " \n " + "http://m.youtube.com/watch?v=" + VideoUrl + "\n";
    }
    return FeedbackMessage;
}
Gary Wright
  • 2,441
  • 1
  • 20
  • 32
Devi Prasad
  • 829
  • 1
  • 11
  • 33
  • Please check the link below http://stackoverflow.com/questions/25633409/windows-phone-8-error-with-navigationcontext-querystring-trygetvalue – Justin CI Mar 03 '15 at 09:00
  • What error are you getting? – Łukasz Rejman Mar 03 '15 at 09:34
  • Now you can pass only a single string the parameter which you can extract and obtain all these values. – vinod8812 Mar 03 '15 at 11:40
  • Hello Jestin C.I thanks for your replay.. your refered code is working in windows phone 8, But not working in Windows Phone 8.1 – Devi Prasad Mar 03 '15 at 11:49
  • I guess you found the answer in this question: http://stackoverflow.com/questions/28829513/does-not-contain-a-definition-for-navigationcontext-in-windows-phone-8-1/28829785 – Łukasz Rejman Mar 03 '15 at 12:15

1 Answers1

0

Try this

string ShowTitle = NavigationContext.QueryString["title"];

Check this also : http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2014/05/23/windows-phone-8-1-frame-page-navigationhelper-suspensionmanager.aspx

Ajay
  • 6,418
  • 18
  • 79
  • 130