Page PageForOption(MenuItem option) { if (option is AboutMenuItem) { return(new AboutPage()); } if (option is VectorSpeechBubbleMenuItem) { return(new VectorSpeechBubblePage()); } if (option is CappedImageMenuItem) { return(new CappedImagePage()); } if (option is RoundedFrameMenuItem) { return(new RoundedFramePage()); } if (option is ChatSampleMenuItem) { return(new ChatPage()); } throw new NotImplementedException("Unknown menu option: " + option.Title); }
Page PageForOption (MenuItem option) { if (option is AboutMenuItem) return new AboutPage (); if (option is VectorSpeechBubbleMenuItem) return new VectorSpeechBubblePage (); if (option is CappedImageMenuItem) return new CappedImagePage (); if (option is RoundedFrameMenuItem) return new RoundedFramePage (); if (option is ChatSampleMenuItem) return new ChatPage (); throw new NotImplementedException("Unknown menu option: " + option.Title); }
/// <summary> /// Navigate to the view for the specified menu option /// </summary> public void NavigateTo(DNA.XForms.Sample.ViewModels.MenuItem option) { if (previousItem != null) previousItem.Selected = false; option.Selected = true; previousItem = option; var displayPage = PageForOption(option); Device.OnPlatform (WinPhone: () => Detail = new ContentPage ()); //work around to clear current page. Detail = new NavigationPage(displayPage) { BarBackgroundColor = ColorHelper.ToolbarBackground, BarTextColor = Color.White, }; IsPresented = false; }
/// <summary> /// Navigate to the view for the specified menu option /// </summary> public void NavigateTo(DNA.XForms.Sample.ViewModels.MenuItem option) { if (previousItem != null) { previousItem.Selected = false; } option.Selected = true; previousItem = option; var displayPage = PageForOption(option); Device.OnPlatform(WinPhone: () => Detail = new ContentPage()); //work around to clear current page. Detail = new NavigationPage(displayPage) { BarBackgroundColor = ColorHelper.ToolbarBackground, BarTextColor = Color.White, }; IsPresented = false; }