-
Notifications
You must be signed in to change notification settings - Fork 1
/
SearchPage.xaml
81 lines (75 loc) · 4.58 KB
/
SearchPage.xaml
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
<Page
x:Class="CollectAnswers.SearchPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CollectAnswers"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:data="using:CollectAnswers.Models"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Loaded="Page_Loaded">
<Page.Resources>
<DataTemplate x:DataType="data:Post" x:Key="PostsTemplate">
<StackPanel Margin="8" HorizontalAlignment="Stretch">
<TextBlock FontSize="16" Text="{x:Bind PostIdConverted()}" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="{x:Bind Text}" TextWrapping="Wrap" VerticalAlignment="Top"></TextBlock>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" >
<TextBlock Margin="0,5,0,4" Text="Pridal: " Foreground="Gray" VerticalAlignment="Center"></TextBlock>
<TextBlock Margin="4,5,0,4" Text="{x:Bind AuthorName}" Foreground="Gray" TextWrapping="Wrap" VerticalAlignment="Center"></TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" >
<TextBlock Margin="4" FontFamily="Segoe MDL2" Text="{x:Bind ReactionsCountConverted()}" Foreground="Gray" TextWrapping="Wrap" VerticalAlignment="Center"></TextBlock>
<TextBlock Margin="4" FontFamily="Segoe MDL2 Assets" Text="" Foreground="Gray" TextWrapping="Wrap" VerticalAlignment="Center"></TextBlock>
</StackPanel>
</StackPanel>
</DataTemplate>
</Page.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition Height="230"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Style="{StaticResource NavigationBackButtonNormalStyle}" VerticalAlignment="Center" Margin="16" Click="Button_HandleBack"/>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto">
<StackPanel Padding="8" Margin="8" VerticalAlignment="Center">
<TextBlock Grid.Row="0"
Text="Collect Answer - Vyhľadávanie" FontSize="24px" HorizontalAlignment="Center"></TextBlock>
<TextBox x:Name="txtPost"
Grid.Row="0"
Margin="8"
HorizontalAlignment="Center"
TextWrapping="Wrap"
MaxLength="512"
MinHeight="30"
MaxHeight="100"
MinWidth="500"
MaxWidth="500"
PlaceholderText="Napíšte kľúčové slová sem..."
FocusDisengaged="txtPost_FocusDisengaged"
TextChanged="txtPost_TextChanged"/>
</StackPanel>
</ScrollViewer>
<TextBlock Grid.Row="1" x:Name="postsInfo" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap"/>
</Grid>
</ScrollViewer>
<ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Auto">
<Grid VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Background="WhiteSmoke" Margin="100, 0, 100, 0" Padding="8" MaxWidth="1000">
<ListView x:Name="listViewPosts" ItemsSource="{x:Bind Posts}" ItemTemplate="{StaticResource PostsTemplate}" VerticalAlignment="Stretch" IsItemClickEnabled="True" ItemClick="ListView_ItemClick"/>
</Grid>
<Button Grid.Row="1" x:Name="loadMoreButton" Content="Vyhľadať viac" Foreground="Black" Background="LightGray" Click="loadMoreButton_Click" Margin="100, 0, 100, 0" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
</Grid>
</ScrollViewer>
</Grid>
</Page>