From 42efc9fb9f20b0730efa74d76d940226e689048f Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Wed, 14 Jun 2017 21:38:06 +0200 Subject: Made some pages responsive and added back button. --- .../Board member pages/BmCreateApartmentPage.xaml | 38 ++---- .../BmCreateApartmentPage.xaml.cs | 13 +- .../Board member pages/BmCreateChangePage.xaml | 142 ++++++++++----------- .../Board member pages/BmCreateChangePage.xaml.cs | 19 +-- .../Board member pages/BmEditApartmentPage.xaml | 51 +++----- .../Board member pages/BmEditApartmentPage.xaml.cs | 13 +- 6 files changed, 121 insertions(+), 155 deletions(-) diff --git a/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateApartmentPage.xaml b/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateApartmentPage.xaml index 3c63754..6da2135 100644 --- a/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateApartmentPage.xaml +++ b/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateApartmentPage.xaml @@ -17,7 +17,7 @@ - + - - diff --git a/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateApartmentPage.xaml.cs b/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateApartmentPage.xaml.cs index 41c3f67..49a25d5 100644 --- a/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateApartmentPage.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateApartmentPage.xaml.cs @@ -1,4 +1,5 @@ -using Windows.UI.Xaml.Controls; +using Windows.UI.Core; +using Windows.UI.Xaml.Controls; namespace ApartmentManager.View { @@ -7,9 +8,19 @@ namespace ApartmentManager.View /// public sealed partial class BmCreateApartmentPage : Page { + private readonly SystemNavigationManager _currentView = SystemNavigationManager.GetForCurrentView(); + public BmCreateApartmentPage() { InitializeComponent(); + _currentView.BackRequested += OnBackRequested; + _currentView.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; + } + + private void OnBackRequested(object sender, BackRequestedEventArgs e) + { + Frame.Navigate(typeof(BmApartmentsPage)); + _currentView.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; } } } diff --git a/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateChangePage.xaml b/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateChangePage.xaml index e2e19cd..d9197f7 100644 --- a/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateChangePage.xaml +++ b/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateChangePage.xaml @@ -15,83 +15,75 @@ - - - - - - - - - - - - - - - - - + + + diff --git a/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateChangePage.xaml.cs b/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateChangePage.xaml.cs index 054bca6..842ec92 100644 --- a/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateChangePage.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/Board member pages/BmCreateChangePage.xaml.cs @@ -1,24 +1,9 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; - -// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 +using Windows.UI.Xaml.Controls; namespace ApartmentManager.View { /// - /// An empty page that can be used on its own or navigated to within a Frame. + /// Page for creating changes. /// public sealed partial class BmCreateChangePage : Page { diff --git a/ApartmentManager/ApartmentManager/View/Board member pages/BmEditApartmentPage.xaml b/ApartmentManager/ApartmentManager/View/Board member pages/BmEditApartmentPage.xaml index 46ea641..bf35ee7 100644 --- a/ApartmentManager/ApartmentManager/View/Board member pages/BmEditApartmentPage.xaml +++ b/ApartmentManager/ApartmentManager/View/Board member pages/BmEditApartmentPage.xaml @@ -16,7 +16,7 @@ - + - - + Content="Update apartment" + Foreground="White" Margin="0,10,0,0"> + + + + + + diff --git a/ApartmentManager/ApartmentManager/View/Board member pages/BmEditApartmentPage.xaml.cs b/ApartmentManager/ApartmentManager/View/Board member pages/BmEditApartmentPage.xaml.cs index 63e71eb..af002a8 100644 --- a/ApartmentManager/ApartmentManager/View/Board member pages/BmEditApartmentPage.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/Board member pages/BmEditApartmentPage.xaml.cs @@ -1,4 +1,5 @@ -using Windows.UI.Xaml.Controls; +using Windows.UI.Core; +using Windows.UI.Xaml.Controls; namespace ApartmentManager.View { @@ -7,9 +8,19 @@ namespace ApartmentManager.View /// public sealed partial class BmEditApartmentPage : Page { + private readonly SystemNavigationManager _currentView = SystemNavigationManager.GetForCurrentView(); + public BmEditApartmentPage() { InitializeComponent(); + _currentView.BackRequested += OnBackRequested; + _currentView.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; + } + + private void OnBackRequested(object sender, BackRequestedEventArgs e) + { + Frame.Navigate(typeof(BmApartmentsPage)); + _currentView.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; } } } -- cgit v1.2.3