/// <summary> /// Initializes a new instance of the <see cref="TreeWatch.MapMasterDetailPage"/> class. /// </summary> public MapMasterDetailPage() { // set testing style id this.StyleId = "MapMasterDetailPage"; // set view model for all pages var mapViewModel = new MapViewModel(); // Create the master page with the ListView. var mapMenuContentPage = new MapMenuContentPage(mapViewModel); mapMenuContentPage.FieldSelected += (sender, e) => { IsPresented = false; }; this.Master = mapMenuContentPage; this.Detail = TargetPlatform.iOS == Device.OS ? new MapNavigationPage(new MapContentPage(mapViewModel)) as Page : new MapContentPage(mapViewModel); // configuration of this page this.MasterBehavior = MasterBehavior.Popover; this.Title = this.Detail.Title; if (Detail.Icon != null) { this.Icon = this.Detail.Icon; } }