aurora/Aurora/Frontend/Views/MainView/NavigationMenu.xaml.cs
2019-05-17 18:21:02 -04:00

57 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Aurora.Frontend.Views.Main
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class NavigationMenu : ContentPage
{
public ListView ListView;
public NavigationMenu()
{
InitializeComponent();
BindingContext = new MainViewMasterViewModel();
ListView = MenuItemsListView;
}
class MainViewMasterViewModel : INotifyPropertyChanged
{
public ObservableCollection<NavigationItem> MenuItems { get; set; }
public MainViewMasterViewModel()
{
MenuItems = new ObservableCollection<NavigationItem>(new[]
{
new NavigationItem { Id = 0, Title = "Page 1" },
new NavigationItem { Id = 1, Title = "Page 2" },
new NavigationItem { Id = 2, Title = "Page 3" },
new NavigationItem { Id = 3, Title = "Page 4" },
new NavigationItem { Id = 4, Title = "Page 5" },
});
}
#region INotifyPropertyChanged Implementation
public event PropertyChangedEventHandler PropertyChanged;
void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
if (PropertyChanged == null)
return;
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
}
}
}