From 77651496e175e97ab92224c0d69b30d270dd6c88 Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Fri, 28 Apr 2017 17:57:00 +0200 Subject: Fixed AppShell. --- .../ApartmentManager/ApartmentManager.csproj | 16 + ApartmentManager/ApartmentManager/App.xaml | 9 + ApartmentManager/ApartmentManager/AppShell.xaml | 11 +- ApartmentManager/ApartmentManager/AppShell.xaml.cs | 23 +- .../ApartmentManager/Styles/Styles.xaml | 557 +++++++++++++++++++++ .../ApartmentManager/View/LoginPage.xaml.cs | 27 +- 6 files changed, 616 insertions(+), 27 deletions(-) create mode 100644 ApartmentManager/ApartmentManager/Styles/Styles.xaml diff --git a/ApartmentManager/ApartmentManager/ApartmentManager.csproj b/ApartmentManager/ApartmentManager/ApartmentManager.csproj index 3768365..1f2eda3 100644 --- a/ApartmentManager/ApartmentManager/ApartmentManager.csproj +++ b/ApartmentManager/ApartmentManager/ApartmentManager.csproj @@ -138,6 +138,22 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + Designer MSBuild:Compile diff --git a/ApartmentManager/ApartmentManager/App.xaml b/ApartmentManager/ApartmentManager/App.xaml index e4c9342..37c4add 100644 --- a/ApartmentManager/ApartmentManager/App.xaml +++ b/ApartmentManager/ApartmentManager/App.xaml @@ -5,4 +5,13 @@ xmlns:local="using:ApartmentManager" RequestedTheme="Light"> + + + + + + + + + diff --git a/ApartmentManager/ApartmentManager/AppShell.xaml b/ApartmentManager/ApartmentManager/AppShell.xaml index 28d40e3..e775b93 100644 --- a/ApartmentManager/ApartmentManager/AppShell.xaml +++ b/ApartmentManager/ApartmentManager/AppShell.xaml @@ -19,7 +19,7 @@ --> - + @@ -73,14 +73,11 @@ - - + + - - - - + diff --git a/ApartmentManager/ApartmentManager/AppShell.xaml.cs b/ApartmentManager/ApartmentManager/AppShell.xaml.cs index ed86a46..0bd4f7f 100644 --- a/ApartmentManager/ApartmentManager/AppShell.xaml.cs +++ b/ApartmentManager/ApartmentManager/AppShell.xaml.cs @@ -23,7 +23,7 @@ namespace ApartmentManager { Symbol = Symbol.Home, Label = "Home", - DestPage = typeof(LoginPage), + DestPage = typeof(ApartmentPage), IsSelected = true } }); @@ -39,11 +39,11 @@ namespace ApartmentManager { InitializeComponent(); - List topNavMenuItems = navMenuItems.GetRange(0, 3); - List bottomNavMenuItems = navMenuItems.GetRange(3, 2); + List topNavMenuItems = navMenuItems.GetRange(0, 1); + // List bottomNavMenuItems = navMenuItems.GetRange(3, 2); NavMenuList.ItemsSource = topNavMenuItems; - NavMenuList2.ItemsSource = bottomNavMenuItems; + // NavMenuList2.ItemsSource = bottomNavMenuItems; } public Frame AppFrame { get { return Frame; } } @@ -140,20 +140,5 @@ namespace ApartmentManager StackPanel1.Visibility = Visibility.Collapsed; StackPanel2.Visibility = Visibility.Visible; } - - private void GoToLoginView(object sender, RoutedEventArgs e) - { - Frame.Navigate(typeof(LoginView)); - } - - private void GoToCreateUserView(object sender, RoutedEventArgs e) - { - Frame.Navigate(typeof(CreateUserView)); - } - - private void GoToUserView(object sender, RoutedEventArgs e) - { - Frame.Navigate(typeof(UserView)); - } } } \ No newline at end of file diff --git a/ApartmentManager/ApartmentManager/Styles/Styles.xaml b/ApartmentManager/ApartmentManager/Styles/Styles.xaml new file mode 100644 index 0000000..0b53355 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Styles/Styles.xaml @@ -0,0 +1,557 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs b/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs index dcc17ee..6f3a86b 100644 --- a/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs @@ -29,7 +29,32 @@ namespace ApartmentManager.View private void click(object sender, RoutedEventArgs e) { - Frame.Navigate(typeof(ApartmentPage)); + AppShell appShell = Window.Current.Content as AppShell; + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (appShell == null) + { + // Create a AppShell to act as the navigation context and navigate to the first page + appShell = new AppShell(); + + // Set the default language + appShell.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; + + } + + // Place our app shell in the current Window + Window.Current.Content = appShell; + + if (appShell.AppFrame.Content == null) + { + // When the navigation stack isn't restored, navigate to the first page + // suppressing the initial entrance animation. + appShell.AppFrame.Navigate(typeof(ApartmentPage)); + } + + // Ensure the current window is active + Window.Current.Activate(); } } } -- cgit v1.2.3