Cos*_*tas 1 c# xamarin xamarin.forms
我的项目中有一个与任何内容都不相关的 .cs 文件Pages
,它由 .cs 文件调用MainPage
。
调用await Navigation.PushAsync(new MyPage());
结果出现以下错误:
Error CS0103 The name 'Navigation' does not exist in the current context
。
将Class
定义从更改class MyClass
为class MyClass : MainPage
错误更改为:Error CS0120 An object reference is required for the non-static field, method, or property 'NavigableElement.Navigation'
哪种调用方式正确Navigation.PushAsync()
且不会出错?
归档时间: |
|
查看次数: |
94 次 |
最近记录: |