aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Adamonis <dona0169@edu.easj.dk>2017-04-28 21:54:59 +0200
committerDonatas Adamonis <dona0169@edu.easj.dk>2017-04-28 21:54:59 +0200
commit7492100dc9e33175feacbe936498a9fe153b2315 (patch)
treeaf1ed704d3066e01e6c27d43a2e965339820925d
parentaf2c151d07d1ef851cc6098eb386b9750601de0b (diff)
Bindind apartment page
-rw-r--r--ApartmentManager/ApartmentManager/Model/Apartment.cs6
-rw-r--r--ApartmentManager/ApartmentManager/Model/CatalogSingleton.cs5
-rw-r--r--ApartmentManager/ApartmentManager/View/ApartmentPage.xaml35
3 files changed, 33 insertions, 13 deletions
diff --git a/ApartmentManager/ApartmentManager/Model/Apartment.cs b/ApartmentManager/ApartmentManager/Model/Apartment.cs
index b136bd2..fb67904 100644
--- a/ApartmentManager/ApartmentManager/Model/Apartment.cs
+++ b/ApartmentManager/ApartmentManager/Model/Apartment.cs
@@ -13,18 +13,18 @@ namespace ApartmentManager.Model
public int NumberOfRooms { get; set; }
public string MonthlyCharge { get; set; }
public int Floor { get; set; }
-
+ public string Address { get; set; }
public Apartment() { }
- public Apartment(int ApartmentNumber, string Size,int NumberOfRooms,string MonthlyCharge,int Floor)
+ public Apartment(int ApartmentNumber, string Size,int NumberOfRooms,string MonthlyCharge,int Floor, string Address)
{
this.ApartmentNumber = ApartmentNumber;
this.Size = Size;
this.NumberOfRooms = NumberOfRooms;
this.MonthlyCharge = MonthlyCharge;
this.Floor = Floor;
-
+ this.Address = Address;
}
diff --git a/ApartmentManager/ApartmentManager/Model/CatalogSingleton.cs b/ApartmentManager/ApartmentManager/Model/CatalogSingleton.cs
index 1ff168f..160d332 100644
--- a/ApartmentManager/ApartmentManager/Model/CatalogSingleton.cs
+++ b/ApartmentManager/ApartmentManager/Model/CatalogSingleton.cs
@@ -14,11 +14,14 @@ namespace ApartmentManager.Model
public static CatalogSingleton Instance => instance;
public ObservableCollection<User> User { get; set; }
-
+ public ObservableCollection<Apartment> Apartment { get; set; }
+
private CatalogSingleton()
{
+ Apartment = new ObservableCollection<Apartment>();
User = new ObservableCollection<User>();
User.Add(new User("Bibis","Kiausiai",3214568, new DateTime(2017, 1, 5, 2, 27, 0),"Bibis@mail.com",1));
+ Apartment.Add(new Apartment(1,"30 Square meters",2,"200",0,"adresas"));
}
}
}
diff --git a/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml
index e7a6687..9f20238 100644
--- a/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml
+++ b/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml
@@ -15,16 +15,33 @@
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" Width="1000" Margin="50" >
<StackPanel Width="600" Height="300" VerticalAlignment="Top">
- <TextBlock Text="Apartment Address :" FontSize="20" />
- <TextBlock Text="Floor :" FontSize="20"/>
- <TextBlock Text="Apartment Number :" FontSize="20"/>
- <TextBlock Text="Size :" FontSize="20"/>
- <TextBlock Text="Number of Rooms :" FontSize="20"/>
- <TextBlock Text="Monthly Charge:" FontSize="20"/>
-
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Apartment Address :" FontSize="20" Margin="0,0,10,0" />
+ <TextBlock Text="{Binding CatalogSingleton.Apartment[0].Address}" FontSize="20"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Floor :" FontSize="20" Margin="0,0,10,0" />
+ <TextBlock Text="{Binding CatalogSingleton.Apartment[0].Floor}" FontSize="20"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Apartment Number :" FontSize="20" Margin="0,0,10,0"/>
+ <TextBlock Text="{Binding CatalogSingleton.Apartment[0].ApartmentNumber}" FontSize="20"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Size :" FontSize="20" Margin="0,0,10,0"/>
+ <TextBlock Text="{Binding CatalogSingleton.Apartment[0].Size}" FontSize="20" Margin="0,0,10,0"/>
+ <TextBlock Text="m2" FontSize="20"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Number of Rooms :" FontSize="20" Margin="0,0,10,0"/>
+ <TextBlock Text="{Binding CatalogSingleton.Apartment[0].NumberOfRooms}" FontSize="20"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Monthly Charge:" FontSize="20" Margin="0,0,10,0"/>
+ <TextBlock Text="{Binding CatalogSingleton.Apartment[0].MonthlyCharge}" FontSize="20" Margin="0,0,10,0"/>
+ <TextBlock Text="DKK" FontSize="20"/>
+ </StackPanel>
</StackPanel>
-
-
<StackPanel Width="400" Height="300" VerticalAlignment="Top" HorizontalAlignment="Right">
<Button Margin="0,10,0,10" Content="Apartment Plan" HorizontalAlignment="Stretch" Click="click"/>
<Button Margin="0,10,0,10" Content="Personal Info" HorizontalAlignment="Stretch" Click="GotoPernalInfoPage"/>