using System; using System.Collections.Generic; using Aurora.Frontend.Components.NavigationMenu; using Aurora.Frontend.Views.MainView; using Xamarin.Forms; using Xamarin.Forms.Xaml; namespace Aurora.Frontend.Views.Main { [XamlCompilation(XamlCompilationOptions.Compile)] public partial class MainView : MasterDetailPage { public MainView() { InitializeComponent(); BindingContext = new MainViewModel(); MasterPage.ListView.ItemSelected += ListView_ItemSelected; } private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) { var item = e.SelectedItem as NavigationItem; if (item == null) return; var page = (Page)Activator.CreateInstance(item.TargetType); page.Title = item.Title; Detail = new NavigationPage(page); MasterPage.ListView.SelectedItem = null; } } }