34 lines
860 B
C#
34 lines
860 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using Xamarin.Forms;
|
|||
|
using Xamarin.Forms.Xaml;
|
|||
|
|
|||
|
namespace Aurora.Frontend.Views.Main
|
|||
|
{
|
|||
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
|||
|
public partial class MainView : MasterDetailPage
|
|||
|
{
|
|||
|
public MainView()
|
|||
|
{
|
|||
|
InitializeComponent();
|
|||
|
|
|||
|
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;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|