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()且不会出错?