/// <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; } }
/// <summary> /// Initializes a new instance of the <see cref="TreeWatch.MapMenuContentPage"/> class. /// </summary> /// <param name="mapViewModel">Map view model.</param> public MapMenuContentPage(MapViewModel mapViewModel) { this.InitializeComponent(); this.BindingContext = mapViewModel; fieldView.ItemTapped += this.OnFieldSelected; }
/// <summary> /// Initializes a new instance of the <see cref="TreeWatch.MapContentPage"/> class. /// </summary> /// <param name="mapViewModel">Map view model.</param> public MapContentPage(MapViewModel mapViewModel) { this.InitializeComponent(); if (TargetPlatform.Android == Device.OS) { this.Title = "Map"; } // add view model this.BindingContext = mapViewModel; this.SetupMapContentView(); this.SetupToolbarItems(); }