由网友(固执的青春)分享简介:如果我这样做,用户控件里:NavigationService.Navigate(新的URI(/ Alliance.xaml,UriKind.Relative));它说这个错误:这是对象引用是必需的非静态字段,方法或属性System.Windows.Navigation.NavigationService.Navigat...
如果我这样做,用户控件里:
NavigationService.Navigate(新的URI(/ Alliance.xaml,UriKind.Relative));
它说这个错误:
这是对象引用是必需的非静态字段,方法或属性System.Windows.Navigation.NavigationService.Navigate(的System.Uri)
感谢您
嗯,我解决了通过正常的页面作为参数传递给用户控件,所以我能得到的NavigationService。
解决方案 (Application.Current.RootVisual为PhoneApplicationFrame).Navigate(URI);
If I do this inside a User Control:
NavigationService.Navigate(new Uri("/Alliance.xaml", UriKind.Relative));
it says this error:
An object reference is required for the non-static field, method, or property 'System.Windows.Navigation.NavigationService.Navigate(System.Uri)'
Thank you
Well, I solved passing the normal Page as an argument to the User Control, so I could get the NavigationService.
解决方案(Application.Current.RootVisual as PhoneApplicationFrame).Navigate(uri);
相关推荐
最新文章