diff options
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 @@ <StackPanel.DataContext> <vm:LoginViewModel/> </StackPanel.DataContext> - <AppBarButton Icon="Contact" Label="My account" Style="{StaticResource SignButtonStyle}" Width="Auto"/> + <AppBarButton Icon="Contact" Label="My account" Style="{StaticResource SignButtonStyle}" Width="Auto" Click="MyAccountButton_Click"/> <AppBarButton Icon="Sync" Label="Logout" Style="{StaticResource SignButtonStyle}" Width="Auto" Command="{Binding LogOutCommand}"/> </StackPanel> </Grid> 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<NavMenuItem> navMenuItems = new List<NavMenuItem>( + private List<NavMenuItem> navMenuItems; + + private List<NavMenuItem> normalUserMenuItems = new List<NavMenuItem>( new[] { new NavMenuItem() @@ -29,6 +31,43 @@ namespace ApartmentManager 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<NavMenuItem> boardMemberMenuItems = new List<NavMenuItem>( + new[] + { + new NavMenuItem() + { + Symbol = Symbol.Home, + Label = "Home", + DestPage = typeof(BoardMembersPage), + IsSelected = true + }, + + new NavMenuItem() + { Symbol = Symbol.Comment, Label = "Defects", DestPage = typeof(BoardMembersDefectsPage), @@ -63,7 +102,10 @@ namespace ApartmentManager { InitializeComponent(); - List<NavMenuItem> topNavMenuItems = navMenuItems.GetRange(0, 4); + if (UserSingleton.CurrentUser.Type == "B") navMenuItems = boardMemberMenuItems; + else navMenuItems = normalUserMenuItems; + + List<NavMenuItem> topNavMenuItems = navMenuItems.GetRange(0, navMenuItems.Count); // List<NavMenuItem> 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 @@ <Page - x:Class="ApartmentManager.View.PlanPage" + x:Class="ApartmentManager.View.ApartmentPlanPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:ApartmentManager.View" diff --git a/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml.cs b/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml.cs index bce6221..45feb63 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml.cs @@ -20,9 +20,9 @@ namespace ApartmentManager.View /// <summary> /// An empty page that can be used on its own or navigated to within a Frame. /// </summary> - 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"> <Page.DataContext> 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 /// <summary> /// An empty page that can be used on its own or navigated to within a Frame. /// </summary> - public sealed partial class ResidentsPage : Page + public sealed partial class ApartmentResidentsPage : Page { - public ResidentsPage() + public ApartmentResidentsPage() { this.InitializeComponent(); } |