System.InvalidCastException: Specified cast is not valid, caused by casting Master Detail Page

Be1conBe1con Member ✭✭

Hi,

I just developed the application which has button that can redirect within the same Master Detail Page, but still retain the hamburger button. In this case I used the code as followed:

((HamburgerMenu)Parent).Detail = new NavigationPage(new MyNextPage());

Then, when I tested on Android Emulator, this happened:

System.InvalidCastException: Specified cast is not valid.

I'm not sure what is caused the problem because when I used StackLayout, it never caused this problem. If you have any solution, don't hesitate to reply this thread, I can't be more welcome.

Thanks!

Answers

Sign In or Register to comment.