0
votes

I Am creating a new universal windows app in the visual studio 2015. In the main page i am using frame to navigate one page to another page. but i cannot assign the page to navigate.It shows like this error cannot convert the System.uri to System.Type. I don't know why the same code working in the wpf properly but i can't in UWP. What is the reason for this??

       mainframe.Navigate(new System.Uri("firstpagedemo.xaml", UriKind.Relative));

This is my code how can i change the type of that parameter. Mainframe is my frame's name.

1
You need a typeof operator. Look carefully at the samples - kennyzx
could you please help me to solve this @kennyzx??? - G.suren
something like mainframe.Navigate(typeof(firstpagedemo)). You get this error becuase the method accepts a Type, not a Uri. find MSDN for reference. - kennyzx
that works @ken - G.suren

1 Answers

2
votes

In UWP, the Frame.Navigate method takes the type of the Page as argument:

mainframe.Navigate(typeof(firstpagedemo));