NavigationView How to get a initial page in the NavigationView #1221
Unanswered
wushuaixue
asked this question in
Q&A
Replies: 2 comments
-
Thanks a lot! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I actually a noob for wpf, so dont blame my ignorant.
I need to open a page when i open the app. when I look at the web in our wpfui, in the Navigation View page. I noticed that there is one way to set the navigation manually.
RootNavigation.Navigate("dashboard");
RootNavigation.Navigate(typeof(MyDashboardClass));
I tried that but I actually dont found that PageTag in the ui:NavigationViewItem. And the other function of the navigation, when I write like that I will got a 严重性 代码 说明 项目 文件 行 禁止显示状态 详细信息
错误 CS1503 参数 1: 无法从“int”转换为“System.Type” LKSCANUI D:\C#PRO\LKSCANUI\LKSCANUI\MainWindow.xaml.cs 114 活动 that means that we can not transfer a int into the System.Type
RootNavigation.Navigate(2);
after that, I noticed that The function Navigation have a para pageIdOrTargetTag, so I just set TargetPageTag="MeasureTag" in the NavigationItem and use the xamlNavagationView.Navigate("MeasureTag"); I got a error System.NullReferenceException:“Object reference not set to an instance of an object.” I noticed that i could enter into the Measure class and It finished it's InitializeComponent. So I truely confused about that.


Beta Was this translation helpful? Give feedback.
All reactions