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
Asked
Active
Viewed 343 times
1 Answers
0
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)

Houssem
- 1,042
- 7
- 16
-
Thank you, I would never have thought that the problem was in this. There really was a conflict of names. – Apr 12 '18 at 21:08