Example #1
0
        public async Task NavigateFromMenu(int id)
        {
            if (lastDisplayedId != id)
            {
                switch (id)
                {
                case (int)MenuItemType.BrowseMaps:
                    mapInstance = MapsPage.SelfInstance ?? new MapsPage();
                    Detail      = new NavigationPage(mapInstance);              // Page will be instantiated once per app launch
                    break;

                case (int)MenuItemType.About:
                    Detail = new NavigationPage(new AboutPage());
                    break;
                }
                lastDisplayedId = id;
            }

            if (Device.RuntimePlatform == Device.Android)
            {
                await Task.Delay(100);
            }

            IsPresented = false;
        }
        public MapsPage()
        {
            InitializeComponent();

            SelfInstance   = this;
            BindingContext = new MapsViewModel();
        }