From e32882839ce89f0adc09937e6fded1ec43b9214c Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Sat, 6 May 2017 19:07:01 +0200 Subject: Updated hamburger menu to display different items based on the user type, added a few entries, renamed page namespaces according to filenames. --- ApartmentManager/ApartmentManager/AppShell.xaml | 2 +- ApartmentManager/ApartmentManager/AppShell.xaml.cs | 51 +++++++++++++++++++++- .../ApartmentManager/View/ApartmentPage.xaml.cs | 4 +- .../ApartmentManager/View/ApartmentPlanPage.xaml | 2 +- .../View/ApartmentPlanPage.xaml.cs | 4 +- .../View/ApartmentResidentsPage.xaml | 2 +- .../View/ApartmentResidentsPage.xaml.cs | 4 +- 7 files changed, 58 insertions(+), 11 deletions(-) diff --git a/ApartmentManager/ApartmentManager/AppShell.xaml b/ApartmentManager/ApartmentManager/AppShell.xaml index 7f374de..9eff1e7 100644 --- a/ApartmentManager/ApartmentManager/AppShell.xaml +++ b/ApartmentManager/ApartmentManager/AppShell.xaml @@ -75,7 +75,7 @@ - + diff --git a/ApartmentManager/ApartmentManager/AppShell.xaml.cs b/ApartmentManager/ApartmentManager/AppShell.xaml.cs index a673b1b..9d4abe5 100644 --- a/ApartmentManager/ApartmentManager/AppShell.xaml.cs +++ b/ApartmentManager/ApartmentManager/AppShell.xaml.cs @@ -16,7 +16,9 @@ namespace ApartmentManager public sealed partial class AppShell : Page { // Declare the top level nav items - private List navMenuItems = new List( + private List navMenuItems; + + private List normalUserMenuItems = new List( new[] { new NavMenuItem() @@ -27,6 +29,43 @@ namespace ApartmentManager IsSelected = true }, + new NavMenuItem() + { + Symbol = Symbol.Calendar, + Label = "Apartment plan", + DestPage = typeof(ApartmentPlanPage), + IsSelected = false + }, + + new NavMenuItem() + { + Symbol = Symbol.AddFriend, + Label = "Residents", + DestPage = typeof(ApartmentResidentsPage), + IsSelected = false + }, + + new NavMenuItem() + { + Symbol = Symbol.Contact, + Label = "Personal info", + DestPage = typeof(PersonalInfoPage), + IsSelected = false + }, + + }); + + private List boardMemberMenuItems = new List( + new[] + { + new NavMenuItem() + { + Symbol = Symbol.Home, + Label = "Home", + DestPage = typeof(BoardMembersPage), + IsSelected = true + }, + new NavMenuItem() { Symbol = Symbol.Comment, @@ -63,7 +102,10 @@ namespace ApartmentManager { InitializeComponent(); - List topNavMenuItems = navMenuItems.GetRange(0, 4); + if (UserSingleton.CurrentUser.Type == "B") navMenuItems = boardMemberMenuItems; + else navMenuItems = normalUserMenuItems; + + List topNavMenuItems = navMenuItems.GetRange(0, navMenuItems.Count); // List bottomNavMenuItems = navMenuItems.GetRange(3, 2); NavMenuList.ItemsSource = topNavMenuItems; @@ -152,5 +194,10 @@ namespace ApartmentManager { TogglePaneButton.IsChecked = true; } + + private void MyAccountButton_Click(object sender, RoutedEventArgs e) + { + Frame.Navigate(typeof(PersonalInfoPage)); + } } } \ No newline at end of file diff --git a/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml.cs b/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml.cs index 60ab2f2..4e5d4c9 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml.cs @@ -29,7 +29,7 @@ namespace ApartmentManager.View private void click(object sender, RoutedEventArgs e) { - Frame.Navigate(typeof(PlanPage)); + Frame.Navigate(typeof(ApartmentPlanPage)); } private void GotoPernalInfoPage(object sender, RoutedEventArgs e) @@ -39,7 +39,7 @@ namespace ApartmentManager.View private void ResidentPage(object sender, RoutedEventArgs e) { - Frame.Navigate(typeof(ResidentsPage)); + Frame.Navigate(typeof(ApartmentResidentsPage)); } } } diff --git a/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml index df51ff8..badc50f 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml +++ b/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml @@ -1,5 +1,5 @@  /// An empty page that can be used on its own or navigated to within a Frame. /// - public sealed partial class PlanPage : Page + public sealed partial class ApartmentPlanPage : Page { - public PlanPage() + public ApartmentPlanPage() { this.InitializeComponent(); } diff --git a/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml index c68b1bc..348ba30 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml +++ b/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ViewModel="using:ApartmentManager.ViewModel" - x:Class="ApartmentManager.View.ResidentsPage" + x:Class="ApartmentManager.View.ApartmentResidentsPage" mc:Ignorable="d"> diff --git a/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml.cs b/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml.cs index 46e9f6f..0df2861 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml.cs @@ -20,9 +20,9 @@ namespace ApartmentManager.View /// /// An empty page that can be used on its own or navigated to within a Frame. /// - public sealed partial class ResidentsPage : Page + public sealed partial class ApartmentResidentsPage : Page { - public ResidentsPage() + public ApartmentResidentsPage() { this.InitializeComponent(); } -- cgit v1.2.3