diff options
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 @@      <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">          <Grid>              <Grid.ColumnDefinitions> -                <ColumnDefinition Width="600" /> +                <ColumnDefinition />                  <ColumnDefinition Width="300" />              </Grid.ColumnDefinitions>              <Button @@ -32,7 +32,7 @@                  Source="{Binding ApartmentTemplate.PlanPicture}" />              <StackPanel                  Grid.Column="1" -                Margin="20,0,0,0" +                Margin="20,0"                  VerticalAlignment="Top"                  Orientation="Vertical">                  <TextBlock @@ -41,39 +41,24 @@                      FontSize="20"                      FontWeight="Bold"                      Text="Apartment information:" /> -                <TextBlock Margin="0,10,0,10" Text="Apartment number:" /> +                <TextBlock Margin="0,5,0,1" Text="Apartment number:" />                  <TextBox Text="{Binding ApartmentTemplate.ApartmentId, Mode=TwoWay}" /> -                <TextBlock Margin="0,10,0,10" Text="Square meters:" /> +                <TextBlock Margin="0,5,0,1" Text="Square meters:" />                  <TextBox Text="{Binding ApartmentTemplate.Size, Mode=TwoWay}" /> -                <TextBlock Margin="0,10,0,10" Text="Number of rooms:" /> +                <TextBlock Margin="0,5,0,1" Text="Number of rooms:" />                  <TextBox Text="{Binding ApartmentTemplate.NumberOfRooms, Mode=TwoWay}" /> -                <TextBlock Margin="0,10,0,10" Text="Monthly charge:" /> +                <TextBlock Margin="0,5,0,1" Text="Monthly charge:" />                  <TextBox Text="{Binding ApartmentTemplate.MonthlyCharge, Mode=TwoWay}" /> -                <TextBlock Margin="0,10,0,10" Text="Floor:" /> +                <TextBlock Margin="0,5,0,1" Text="Floor:" />                  <TextBox Text="{Binding ApartmentTemplate.Floor, Mode=TwoWay}" /> -                <TextBlock Margin="0,10,0,10" Text="Address:" /> +                <TextBlock Margin="0,5,0,1" Text="Address:" />                  <TextBox Text="{Binding ApartmentTemplate.Address, Mode=TwoWay}" /> -                <StackPanel -                    Width="150" -                    Margin="0,20,0,0" -                    HorizontalAlignment="Right" -                    Orientation="Horizontal"> -                    <Button -                        Margin="0,0,20,0" -                        HorizontalAlignment="Right" -                        Content="Go back"> -                        <interactivity:Interaction.Behaviors> -                            <core:EventTriggerBehavior EventName="Click"> -                                <core:NavigateToPageAction TargetPage="ApartmentManager.View.BmApartmentsPage" /> -                            </core:EventTriggerBehavior> -                        </interactivity:Interaction.Behaviors> -                    </Button> -                    <Button +                <Button                          HorizontalAlignment="Right"                          Background="#FF274CCD"                          Command="{Binding CreateApartmentCommand}" -                        Content="Add" -                        Foreground="White"> +                        Content="Add apartement" +                        Foreground="White" Margin="0,10,0,0">                          <interactivity:Interaction.Behaviors>                              <core:EventTriggerBehavior EventName="Click">                                  <core:NavigateToPageAction TargetPage="ApartmentManager.View.BmApartmentsPage" /> @@ -81,7 +66,6 @@                          </interactivity:Interaction.Behaviors>                      </Button>                  </StackPanel> -            </StackPanel>          </Grid>      </Grid>  </Page> 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      /// </summary>      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 @@      </Page.DataContext>      <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> -        <StackPanel HorizontalAlignment="Center" Orientation="Vertical"> -            <TextBlock -                Margin="0,10,0,10" -                HorizontalAlignment="Center" -                FontSize="20" -                FontWeight="Bold" -                Text="Apartment change information" /> -            <StackPanel Orientation="Horizontal"> -                <StackPanel Margin="0,5,30,0"> -                    <ListView -                        Width="500" -                        Height="534" -                        ItemsSource="{Binding ChangeTemplate.Documents, Mode=TwoWay}" -                        SelectedItem="{Binding SelectedChangeDocument, Mode=TwoWay}"> -                        <ListView.ItemTemplate> -                            <DataTemplate> -                                <Image -                                    Width="400" -                                    Margin="10" -                                    Source="{Binding Document}" /> -                            </DataTemplate> -                        </ListView.ItemTemplate> -                    </ListView> -                    <StackPanel Margin="10" Orientation="Horizontal"> -                        <Button -                            Margin="30,0,0,0" -                            Command="{Binding UploadChangeDocumentCommand}" -                            Content="Upload document" /> -                        <Button -                            Margin="170,0,0,0" -                            Command="{Binding DeleteChangeDocumentCommand}" -                            Content="Delete document" /> -                    </StackPanel> -                    <StackPanel Margin="0,30,0,0" Orientation="Horizontal" /> -                    <StackPanel Margin="0,30,0,0" Orientation="Horizontal" /> -                </StackPanel> -                <StackPanel Width="400" Margin="0,0,50,0"> -                    <TextBlock Margin="0,10,0,10" Text="Name" /> -                    <TextBox Text="{Binding ChangeTemplate.Name, Mode=TwoWay}" /> -                    <TextBlock Margin="0,10,0,10" Text="Apartment number" /> -                    <TextBox Text="{Binding ChangeTemplate.ApartmentId, Mode=TwoWay}" /> -                    <TextBlock Margin="0,10,0,10" Text="Description" /> -                    <TextBox -                        Height="345" -                        Text="{Binding ChangeTemplate.Description, Mode=TwoWay}" -                        TextWrapping="Wrap" /> -                    <StackPanel -                        Margin="0,20,0,0" -                        HorizontalAlignment="Right" -                        Orientation="Horizontal"> -                        <Button -                            Margin="0,0,20,0" -                            HorizontalAlignment="Right" -                            Content="Go back"> +        <Grid.RowDefinitions> +            <RowDefinition Height="30" /> +            <RowDefinition /> +            <RowDefinition Height="50"/> +        </Grid.RowDefinitions> +        <Grid.ColumnDefinitions> +            <ColumnDefinition /> +            <ColumnDefinition Width="400" /> +        </Grid.ColumnDefinitions> -                            <interactivity:Interaction.Behaviors> -                                <core:EventTriggerBehavior EventName="Click"> -                                    <core:NavigateToPageAction TargetPage="ApartmentManager.View.BmChangesPage" /> -                                </core:EventTriggerBehavior> -                            </interactivity:Interaction.Behaviors> -                        </Button> -                        <Button -                            HorizontalAlignment="Right" -                            Background="#FF274CCD" -                            Command="{Binding CreateChangeCommand}" -                            Content="Add" -                            Foreground="White"> +        <TextBlock +            Grid.ColumnSpan="2" +            HorizontalAlignment="Center" +            FontSize="20" +            FontWeight="Bold" +            Text="Apartment change information" /> +        <ListView +            Grid.Row="1" +            ItemsSource="{Binding ChangeTemplate.Documents, Mode=TwoWay}" +            SelectedItem="{Binding SelectedChangeDocument, Mode=TwoWay}"> +            <ListView.ItemTemplate> +                <DataTemplate> +                    <Image +                        Width="400" +                        Margin="10" +                        Source="{Binding Document}" /> +                </DataTemplate> +            </ListView.ItemTemplate> +        </ListView> +        <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right"> +            <Button Command="{Binding UploadChangeDocumentCommand}" Content="Upload document" Margin="10,0" /> +            <Button Command="{Binding DeleteChangeDocumentCommand}" Content="Delete document" /> +        </StackPanel> +        <Grid +            Grid.Row="1" +            Grid.Column="1" +            Margin="20,0"> +            <Grid.RowDefinitions> +                <RowDefinition Height="142" /> +                <RowDefinition /> +            </Grid.RowDefinitions> + +            <StackPanel> +                <TextBlock Margin="0,5,0,1" Text="Name" /> +                <TextBox Text="{Binding ChangeTemplate.Name, Mode=TwoWay}" /> +                <TextBlock Margin="0,5,0,1" Text="Apartment number" /> +                <TextBox Text="{Binding ChangeTemplate.ApartmentId, Mode=TwoWay}" /> +                <TextBlock Margin="0,5,0,1" Text="Description" /> -                            <interactivity:Interaction.Behaviors> -                                <core:EventTriggerBehavior EventName="Click"> -                                    <core:NavigateToPageAction TargetPage="ApartmentManager.View.BmChangesPage" /> -                                </core:EventTriggerBehavior> -                            </interactivity:Interaction.Behaviors> -                        </Button> -                    </StackPanel> -                </StackPanel>              </StackPanel> -        </StackPanel> +            <TextBox +                Grid.Row="1" +                Text="{Binding ChangeTemplate.Description, Mode=TwoWay}" +                TextWrapping="Wrap" /> +        </Grid> +        <Button +                Grid.Row="3" +                Grid.Column="1" +                HorizontalAlignment="Right" +                Background="#FF274CCD" +                Command="{Binding CreateChangeCommand}" +                Content="Add change" +                Foreground="White" Margin="0,0,20,0"> + +            <interactivity:Interaction.Behaviors> +                <core:EventTriggerBehavior EventName="Click"> +                    <core:NavigateToPageAction TargetPage="ApartmentManager.View.BmChangesPage" /> +                </core:EventTriggerBehavior> +            </interactivity:Interaction.Behaviors> +        </Button>      </Grid>  </Page> 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  {      /// <summary> -    /// An empty page that can be used on its own or navigated to within a Frame. +    /// Page for creating changes.      /// </summary>      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 @@      <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">          <Grid>              <Grid.ColumnDefinitions> -                <ColumnDefinition Width="600" /> +                <ColumnDefinition/>                  <ColumnDefinition Width="300" />              </Grid.ColumnDefinitions>              <Button @@ -31,7 +31,7 @@                  Source="{Binding ApartmentTemplate.PlanPicture}" />              <StackPanel                  Grid.Column="1" -                Margin="20,0,0,0" +                Margin="20,0"                  VerticalAlignment="Top"                  Orientation="Vertical">                  <TextBlock @@ -40,47 +40,30 @@                      FontSize="20"                      FontWeight="Bold"                      Text="Apartment information:" /> -                <TextBlock Margin="0,10,0,10" Text="Apartment number:" /> +                <TextBlock Margin="0,5,0,1" Text="Apartment number:" />                  <TextBox Text="{Binding ApartmentTemplate.ApartmentId, Mode=TwoWay}" /> -                <TextBlock Margin="0,10,0,10" Text="Square meters:" /> +                <TextBlock Margin="0,5,0,1" Text="Square meters:" />                  <TextBox Text="{Binding ApartmentTemplate.Size, Mode=TwoWay}" /> -                <TextBlock Margin="0,10,0,10" Text="Number of rooms:" /> +                <TextBlock Margin="0,5,0,1" Text="Number of rooms:" />                  <TextBox Text="{Binding ApartmentTemplate.NumberOfRooms, Mode=TwoWay}" /> -                <TextBlock Margin="0,10,0,10" Text="Monthly charge:" /> +                <TextBlock Margin="0,5,0,1" Text="Monthly charge:" />                  <TextBox Text="{Binding ApartmentTemplate.MonthlyCharge, Mode=TwoWay}" /> -                <TextBlock Margin="0,10,0,10" Text="Floor:" /> +                <TextBlock Margin="0,5,0,1" Text="Floor:" />                  <TextBox Text="{Binding ApartmentTemplate.Floor, Mode=TwoWay}" /> -                <TextBlock Margin="0,10,0,10" Text="Address:" /> +                <TextBlock Margin="0,5,0,1" Text="Address:" />                  <TextBox Text="{Binding ApartmentTemplate.Address, Mode=TwoWay}" /> -                <StackPanel -                    Width="170" -                    Margin="0,20,0,0" -                    HorizontalAlignment="Right" -                    Orientation="Horizontal"> -                    <Button -                        Margin="0,0,20,0" -                        HorizontalAlignment="Right" -                        Command="{Binding GetApartmentsCommand}" -                        Content="Go back"> -                        <interactivity:Interaction.Behaviors> -                            <core:EventTriggerBehavior EventName="Click"> -                                <core:NavigateToPageAction TargetPage="ApartmentManager.View.BmApartmentsPage" /> -                            </core:EventTriggerBehavior> -                        </interactivity:Interaction.Behaviors> -                    </Button> -                    <Button +                <Button                          HorizontalAlignment="Right"                          Background="#FF274CCD"                          Command="{Binding UpdateApartmentCommand}" -                        Content="Update" -                        Foreground="White"> -                        <interactivity:Interaction.Behaviors> -                            <core:EventTriggerBehavior EventName="Click"> -                                <core:NavigateToPageAction TargetPage="ApartmentManager.View.BmApartmentsPage" /> -                            </core:EventTriggerBehavior> -                        </interactivity:Interaction.Behaviors> -                    </Button> -                </StackPanel> +                        Content="Update apartment" +                        Foreground="White" Margin="0,10,0,0"> +                    <interactivity:Interaction.Behaviors> +                        <core:EventTriggerBehavior EventName="Click"> +                            <core:NavigateToPageAction TargetPage="ApartmentManager.View.BmApartmentsPage" /> +                        </core:EventTriggerBehavior> +                    </interactivity:Interaction.Behaviors> +                </Button>              </StackPanel>          </Grid>      </Grid> 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      /// </summary>      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;          }      }  }  |