Issue
I have a pages called FirstMainPage and SecondMainPage which both inherit from MasterDetailPage. In my App.cs I do a MainPage.GetType it will return the Type FirstMainPage or SecondMainPage (or something else). How do I get the BasePageType so it returns MasterDetailPage if the page inherits from MasterDetailPage?
I want to be able to cast the MainPage to MasterDetailPage so I can access the MasterDetailPage.Master if it is a MasterDetailPage.
Solution
You can do a simple is
test on your Page
to determine is it is a master-detail:
if (MainPage is MasterDetailPage)
{
var master = (MainPage as MasterDetailPage).Master;
}
Ref: is (C# Reference)
Answered By - SushiHangover
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.