aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <marcin@zelent.net>2017-05-23 12:27:43 +0200
committermarcinzelent <marcin@zelent.net>2017-05-23 12:27:43 +0200
commit4bc22e5f3de02e4678c223333580578808977f8a (patch)
treed0a890b28610b71955b0513f15f7aba0910a9f86
parentefe820e8f4cb9cb44e9516ed99bfe3829003bff7 (diff)
parent4ecd6eeed870067cc045b9690b8eeb0936fe5e04 (diff)
Merge branch 'master' of https://github.com/marcinzelent/ApartmentAdmin
-rw-r--r--ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml179
1 files changed, 92 insertions, 87 deletions
diff --git a/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml
index 8a1f925..3816b09 100644
--- a/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml
+++ b/ApartmentManager/ApartmentManager/View/ApartmentResidentsPage.xaml
@@ -5,9 +5,14 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ViewModel="using:ApartmentManager.ViewModel"
+ xmlns:Common="using:ApartmentManager.Common"
x:Class="ApartmentManager.View.ApartmentResidentsPage"
mc:Ignorable="d">
+ <Page.Resources>
+ <Common:ByteArrayToImageConverter x:Key="ByteArrayToImageConverter"/>
+ </Page.Resources>
+
<Page.DataContext>
<ViewModel:ApartmentViewModel/>
</Page.DataContext>
@@ -15,115 +20,115 @@
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel Margin="10" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="top" >
<StackPanel>
- <Grid Background="LightGray" Height="150" Width="800" Margin="0,0,0,5">
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="150"/>
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <Grid Grid.Column="0" Background="Gray" BorderThickness="0,0,2,0" BorderBrush="#CCFFFFFF" >
- <Image Stretch="Fill" Source="{Binding Picture}"/>
- </Grid>
-
- <Grid Grid.Column="1" Margin="3,3,3,3">
-
- <StackPanel Margin="10">
-
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Full Name :" Margin="0,0,10,0" FontSize="30" FontWeight="Bold" ></TextBlock>
- <TextBlock Text="{Binding UserSingleton.CurrentUser.FirstName}" Margin="0,0,10,0" FontSize="30"></TextBlock>
- <TextBlock Text="{Binding UserSingleton.CurrentUser.LastName}" Margin="0,0,10,0" FontSize="30"></TextBlock>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Email Address :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"></TextBlock>
- <TextBlock Text="{Binding UserSingleton.CurrentUser.Email}" Margin="0,0,10,0" FontSize="20"></TextBlock>
- </StackPanel>
+ <Grid Background="LightGray" Height="150" Width="800" Margin="0,0,0,5">
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="150"/>
+ <ColumnDefinition />
+ </Grid.ColumnDefinitions>
+
+ <Grid Grid.Column="0" Background="Gray" BorderThickness="0,0,2,0" BorderBrush="#CCFFFFFF" >
+ <Image Stretch="Fill" Source="{Binding Picture}"/>
+ </Grid>
+
+ <Grid Grid.Column="1" Margin="3,3,3,3">
+
+ <StackPanel Margin="10">
+
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Full Name :" Margin="0,0,10,0" FontSize="30" FontWeight="Bold" />
+ <TextBlock Text="{Binding UserSingleton.CurrentUser.FirstName}" Margin="0,0,10,0" FontSize="30"/>
+ <TextBlock Text="{Binding UserSingleton.CurrentUser.LastName}" Margin="0,0,10,0" FontSize="30"/>
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Email Address :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"/>
+ <TextBlock Text="{Binding UserSingleton.CurrentUser.Email}" Margin="0,0,10,0" FontSize="20"/>
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Phone Number :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"/>
+ <TextBlock Text="{Binding UserSingleton.CurrentUser.Phone}" Margin="0,0,10,0" FontSize="20"/>
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Birth Date :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"/>
+ <TextBlock Text="{Binding UserSingleton.CurrentUser.BirthDate.Year}" FontSize="20"/>
+ <TextBlock Text="-" FontSize="20"/>
+ <TextBlock Text="{Binding UserSingleton.CurrentUser.BirthDate.Month}" FontSize="20"/>
+ <TextBlock Text="-" FontSize="20"/>
+ <TextBlock Text="{Binding UserSingleton.CurrentUser.BirthDate.Day}" FontSize="20"/>
+ </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Phone Number :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"></TextBlock>
- <TextBlock Text="{Binding UserSingleton.CurrentUser.Phone}" Margin="0,0,10,0" FontSize="20"></TextBlock>
</StackPanel>
-
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Birth Date :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"></TextBlock>
- <TextBlock Text="{Binding UserSingleton.CurrentUser.BirthDate.Year}" FontSize="20"></TextBlock>
- <TextBlock Text="-" FontSize="20"></TextBlock>
- <TextBlock Text="{Binding UserSingleton.CurrentUser.BirthDate.Month }" FontSize="20"></TextBlock>
- <TextBlock Text="-" FontSize="20"></TextBlock>
- <TextBlock Text="{Binding UserSingleton.CurrentUser.BirthDate.Day}" FontSize="20"></TextBlock>
- </StackPanel>
-
- </StackPanel>
+ </Grid>
</Grid>
- </Grid>
- <ListView ItemsSource="{Binding CatalogSingleton.Residents}" Margin="10,10,10,116" SelectedItem="{Binding NewResident, Mode=TwoWay}" >
+ <ListView ItemsSource="{Binding CatalogSingleton.Residents}" Margin="10,10,10,116" SelectedItem="{Binding NewResident, Mode=TwoWay}" >
- <ListView.ItemContainerStyle>
- <Style TargetType="ListViewItem">
- <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
- </Style>
- </ListView.ItemContainerStyle>
+ <ListView.ItemContainerStyle>
+ <Style TargetType="ListViewItem">
+ <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
+ </Style>
+ </ListView.ItemContainerStyle>
- <ListView.ItemTemplate>
+ <ListView.ItemTemplate>
- <DataTemplate>
- <Grid Background="LightGray" Height="150" Width="800" Margin="0,0,0,5">
+ <DataTemplate>
+ <Grid Background="LightGray" Height="150" Width="800" Margin="0,0,0,5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="150"/>
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="150"/>
+ <ColumnDefinition />
+ </Grid.ColumnDefinitions>
- <Grid Grid.Column="0" Background="Gray" BorderThickness="0,0,2,0" BorderBrush="#CCFFFFFF" >
- <Image Stretch="Fill" Source="{Binding Picture, Converter={StaticResource ByteArrayToImageConverter}}"/>
- </Grid>
+ <Grid Grid.Column="0" Background="Gray" BorderThickness="0,0,2,0" BorderBrush="#CCFFFFFF" >
+ <Image Stretch="Fill" Source="{Binding Picture, Converter={StaticResource ByteArrayToImageConverter}}"/>
+ </Grid>
- <Grid Grid.Column="1" Margin="3,3,3,3">
+ <Grid Grid.Column="1" Margin="3,3,3,3">
- <StackPanel Margin="10">
+ <StackPanel Margin="10">
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Full Name :" Margin="0,0,10,0" FontSize="30" FontWeight="Bold" ></TextBlock>
- <TextBlock Text="{Binding FirstName}" Margin="0,0,10,0" FontSize="30"></TextBlock>
- <TextBlock Text="{Binding LastName}" Margin="0,0,10,0" FontSize="30"></TextBlock>
- </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Full Name :" Margin="0,0,10,0" FontSize="30" FontWeight="Bold" />
+ <TextBlock Text="{Binding FirstName}" Margin="0,0,10,0" FontSize="30"/>
+ <TextBlock Text="{Binding LastName}" Margin="0,0,10,0" FontSize="30"/>
+ </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Email Address :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"></TextBlock>
- <TextBlock Text="{Binding Email}" Margin="0,0,10,0" FontSize="20"></TextBlock>
- </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Email Address :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"/>
+ <TextBlock Text="{Binding Email}" Margin="0,0,10,0" FontSize="20"/>
+ </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Phone Number :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"></TextBlock>
- <TextBlock Text="{Binding Phone}" Margin="0,0,10,0" FontSize="20"></TextBlock>
- </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Phone Number :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"/>
+ <TextBlock Text="{Binding Phone}" Margin="0,0,10,0" FontSize="20"/>
+ </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Birth Date :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"></TextBlock>
- <TextBlock Text="{Binding BirthDate.Year}" FontSize="20"></TextBlock>
- <TextBlock Text="-" FontSize="20"></TextBlock>
- <TextBlock Text="{Binding BirthDate.Month}" FontSize="20"></TextBlock>
- <TextBlock Text="-" FontSize="20"></TextBlock>
- <TextBlock Text="{Binding BirthDate.Day}" FontSize="20"></TextBlock>
- </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Birth Date :" Margin="0,0,10,0" FontSize="20" FontWeight="Bold"/>
+ <TextBlock Text="{Binding BirthDate.Year}" FontSize="20"/>
+ <TextBlock Text="-" FontSize="20"/>
+ <TextBlock Text="{Binding BirthDate.Month}" FontSize="20"/>
+ <TextBlock Text="-" FontSize="20"/>
+ <TextBlock Text="{Binding BirthDate.Day}" FontSize="20"/>
+ </StackPanel>
- </StackPanel>
+ </StackPanel>
+ </Grid>
</Grid>
- </Grid>
- </DataTemplate>
+ </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
+ </ListView.ItemTemplate>
+ </ListView>
</StackPanel>
<StackPanel Width="400" Margin="0,0,50,0">
<TextBlock Margin="0,5,0,10" Text="Resident Info" HorizontalAlignment="Center" FontSize="20" FontWeight="Bold"/>
- <Image Source="{Binding NewResident.Picture, Mode=TwoWay}" Height="150" Width="150" ></Image>
- <Button Content="Upload Picture" HorizontalAlignment="Stretch" Margin="0,10,0,0" Command="{Binding UploadResidentPhoto}" ></Button>
+ <Image Source="{Binding NewResident.Picture, Mode=TwoWay}" Height="150" Width="150" />
+ <Button Content="Upload Picture" HorizontalAlignment="Stretch" Margin="0,10,0,0" Command="{Binding UploadResidentPhoto}" />
<TextBlock Margin="0,10,0,10" Text="Name"/>
<TextBox Text="{Binding NewResident.FirstName, Mode=TwoWay}" />
<TextBlock Margin="0,10,0,10" Text="Last Name"/>
@@ -134,7 +139,7 @@
<TextBox Text="{Binding NewResident.Email, Mode=TwoWay}" />
<TextBlock Margin="0,10,0,10" Text="Phone Number"/>
<TextBox Text="{Binding NewResident.Phone, Mode=TwoWay}" />
-
+
<StackPanel Orientation="Horizontal">
<Button Margin="0,5,12,10" Content="Create" Width="125" Command="{Binding CreateResidentCommand}"/>