I get an error in Master Detail page

a 夏天 提交于 2021-01-29 06:13:02

问题


So I create a standard xamarin form project with a default template, then I add a Master Detail page template to the project and when I compile this project on the phone I open the side menu and when I click on Page 1 I get the error "System.InvalidCastException: Specified cast is not valid. " I do not change the default template in any way, but I get an error, I believe that it is related to the transition to Page 1 and I do not understand by what principle this transition occurs. Thanks. enter image description here


回答1:


The problem is related to the name of your view is "Page" or already there is a type in xamarin forms with the same name "Page" try making names more clear. to resolve your problem try forcing the xamarin forms type

(Xamarin.Forms.Page)Activator.CreateInstance(item.TargetType)


来源:https://stackoverflow.com/questions/49800777/i-get-an-error-in-master-detail-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!