-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSearchPage.xaml
58 lines (55 loc) · 4.04 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
<Page
x:Class="ValleyTube.SearchPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ValleyTube"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="Black">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="10">
<TextBox x:Name="SearchBox" HorizontalAlignment="Stretch" VerticalAlignment="Center"
PlaceholderText="Search..." TextChanged="SearchBox_TextChanged" />
</Grid>
<ListView x:Name="SearchListView" Loaded="SearchListView_Loaded" Margin="10" Grid.Row="1" SelectionChanged="SearchListView_SelectionChanged">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0">
<Button Background="Transparent" BorderBrush="Transparent" Padding="0" Click="SearchButton_Click">
<Grid>
<Image Source="{Binding ThumbnailUrl}" Width="120" Height="90" Margin="0,0,10,0" Stretch="UniformToFill"
Visibility="{Binding ThumbnailUrl, Converter={StaticResource NullOrEmptyToVisibilityConverter}}"/>
<Image Source="{Binding FirstAuthorThumbnailUrl, Converter={StaticResource StringToImageSourceConverter}}" Width="90" Height="90"
Margin="0,0,10,0" Stretch="UniformToFill" Visibility="{StaticResource NullOrEmptyToVisibilityConverter}"/>
<Border Background="Black" Opacity="0.8" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0" Padding="0">
<TextBlock Text="{Binding LengthFormatted}" Foreground="White" FontSize="14" FontWeight="Bold"
Visibility="{Binding Type, Converter={StaticResource ChannelTypeToVisibilityConverter}}" />
</Border>
</Grid>
</Button>
<StackPanel>
<TextBlock Text="{Binding Title}" FontSize="20" FontWeight="Bold" Foreground="White"
Visibility="{Binding Title, Converter={StaticResource NullOrEmptyToVisibilityConverter}}"/>
<TextBlock Text="{Binding ChannelHandle}" FontSize="20" FontWeight="Bold" Foreground="White"
Visibility="{Binding ChannelHandle, Converter={StaticResource NullOrEmptyToVisibilityConverter}}"/>
<TextBlock Text="{Binding Author}" FontSize="14" Foreground="Gray"/>
<TextBlock Text="{Binding FormattedSubCount}" FontSize="14" Foreground="Gray"
Visibility="{Binding Type, Converter={StaticResource ChannelTypeToVisibilityConverterOppsite}}"/>
<TextBlock Text="{Binding Description}" FontSize="14" Foreground="Gray"
Visibility="{Binding Description, Converter={StaticResource NullOrEmptyToVisibilityConverter}}"/>
<TextBlock Text="{Binding ViewCountText}" FontSize="14" Foreground="Gray"
Visibility="{Binding ViewCountText, Converter={StaticResource NullOrEmptyToVisibilityConverter}}"/>
<TextBlock Text="{Binding PublishedText}" FontSize="14" Foreground="Gray"
Visibility="{Binding PublishedText, Converter={StaticResource NullOrEmptyToVisibilityConverter}}"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Page>