1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
<Page
x:Class="France_Vacances.View.AccommodationView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:France_Vacances.View"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModel="using:France_Vacances.ViewModel"
mc:Ignorable="d">
<ScrollViewer>
<Grid Background="GhostWhite" Padding="100,10">
<Grid.DataContext>
<viewModel:AccommodationViewModel/>
</Grid.DataContext>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="250"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="400"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.Row="0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding DisplayedAccommodationModel.Name}" FontSize="28"/>
<TextBlock Text="{Binding DisplayedAccommodationModel.Stars}" VerticalAlignment="Center" Margin="10,0,0,0" Foreground="DodgerBlue"/>
</StackPanel>
<TextBlock Margin="10,0,0,0" Foreground="DimGray" >
<Run Text="{Binding DisplayedAccommodationModel.StreetName}"></Run>
<Run Text=","></Run>
<Run Text="{Binding DisplayedAccommodationModel.PostalCode}"></Run>
<Run Text="{Binding DisplayedAccommodationModel.City}"></Run>
<Run Text=","></Run>
<Run Text="{Binding DisplayedAccommodationModel.Region}"></Run>
</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Rating: " FontSize="30" VerticalAlignment="Bottom" Margin="0,0,10,5"/>
<TextBlock Text="{Binding DisplayedAccommodationModel.ReviewScore}" FontSize="50"/>
</StackPanel>
<Grid x:Name="ImageViewer" Grid.Column="0" Grid.Row="1">
<Grid.Background>
<ImageBrush x:Name="ImageViewerBackground" ImageSource="{Binding DisplayedAccommodationModel.Images[0]}" Stretch="Uniform"/>
</Grid.Background>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="<" Background="Transparent" FontSize="48" Click="PreviousImage" HorizontalAlignment="Right"/>
<Button Grid.Column="2" Content=">" Background="Transparent" FontSize="48" Click="NextImage"/>
</Grid>
<Grid Grid.Column="1" Grid.Row="1" Background="DodgerBlue" Margin="0,10" Padding="20" CornerRadius="10">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="60"/>
<RowDefinition Height="60"/>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<TextBlock Text="Price per night:" Foreground="White" FontSize="16" VerticalAlignment="Bottom" TextLineBounds="Tight" Margin="0,0,0,10"/>
<TextBlock Foreground="White" FontWeight="Bold" FontSize="20" VerticalAlignment="Bottom" TextLineBounds="Tight" Margin="10,0,0,10">
<Run Text="{Binding DisplayedAccommodationModel.Price}"></Run>
<Run Text="€"></Run>
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="1">
<TextBlock Text="From:" FontSize="16" Foreground="White" VerticalAlignment="Center"/>
<CalendarDatePicker Date="{Binding StartDateTime, Mode=TwoWay}" HorizontalAlignment="Stretch" />
</StackPanel>
<StackPanel Grid.Row="2">
<TextBlock Text="To:" FontSize="16" Foreground="White" VerticalAlignment="Center"/>
<CalendarDatePicker Date="{Binding EndDateTime, Mode=TwoWay}" HorizontalAlignment="Stretch" />
</StackPanel>
<StackPanel Grid.Row="3">
<TextBlock Text="Overall price:" FontSize="16" Foreground="White" VerticalAlignment="Center"/>
<TextBlock Foreground="White" FontSize="36" FontWeight="Bold"><Run Text="{Binding OverallPrice, Mode=TwoWay}"/> €</TextBlock>
</StackPanel>
<Button Grid.Row="4" Width="150" Height="50" Background="Gold" HorizontalAlignment="Center" Command="{Binding GetBookingInfoCommand}" Click="GoToBookingView">
<Button.Content>
<TextBlock Text="Book" FontWeight="Bold"/>
</Button.Content>
</Button>
</Grid>
<TextBlock Grid.Column="0" Grid.Row="2" Margin="5,20,5,5" Text="{Binding DisplayedAccommodationModel.Description}" TextWrapping="WrapWholeWords"/>
<Grid Grid.Column="1" Grid.Row="2" Margin="0,20,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="47"/>
<RowDefinition Height="20"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel>
<TextBlock>
<Run Text="Rooms: " FontWeight="Bold"/>
<Run Text="{Binding DisplayedAccommodationModel.Rooms}"></Run>
</TextBlock>
<TextBlock>
<Run Text="Persons: " FontWeight="Bold"/>
<Run Text="{Binding DisplayedAccommodationModel.Persons}"></Run>
</TextBlock>
</StackPanel>
<TextBlock Grid.Row="1" Text="Facilities:" FontWeight="Bold"/>
<ListView Grid.Row="2" ItemsSource="{Binding DisplayedAccommodationModel.Facilities}">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="IsHitTestVisible" Value="false"/>
</Style>
</ListView.ItemContainerStyle >
</ListView>
</Grid>
</Grid>
</ScrollViewer>
</Page>
|