-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMainPage.xaml
67 lines (67 loc) · 3.71 KB
/
MainPage.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
<Page
x:Class="SearchProject.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SearchProject.Models"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="wideState">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="641" />
</VisualState.StateTriggers>
</VisualState>
<VisualState x:Name="narrowState">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="contentPanel.Margin" Value="20,30,0,0"/>
<Setter Target="inputPanel.Orientation" Value="Vertical"/>
<Setter Target="inputButton.Margin" Value="0,4,0,0"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ScrollViewer HorizontalAlignment="Left" VerticalAlignment="Top" VerticalScrollBarVisibility="Auto">
<StackPanel x:Name="contentPanel" Margin="120,30,0,0" KeyDown="ContentPanel_KeyDown">
<TextBlock HorizontalAlignment="Left" Text="Search" FontSize="36"/>
<StackPanel x:Name="inputPanel" Orientation="Horizontal" Margin="0,20,0,20">
<TextBox x:Name="searchInput" Width="300" HorizontalAlignment="Left"/>
<Button
x:Name="inputButton"
Content="SEARCH"
Click="Button_Click"
ToolTipService.ToolTip="Shortcut key: Enter"
AutomationProperties.AcceleratorKey="Enter"
/>
</StackPanel>
<ListView Name="ResultsList" ItemsSource="{x:Bind ViewModel.RelatedTopics}" HorizontalAlignment="Left" >
<ListView.ItemTemplate>
<DataTemplate x:DataType="local:RelatedTopic">
<StackPanel Orientation="Vertical" Margin="0,20,0,20">
<TextBlock x:Name="firstUrl" Text="{x:Bind FirstURL}"/>
<TextBlock x:Name="text" TextWrapping="Wrap" Text="{x:Bind Text}"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<ListView Name="TopicsList" ItemsSource="{x:Bind ViewModel.Topics}" HorizontalAlignment="Left" >
<ListView.ItemTemplate>
<DataTemplate x:DataType="local:Topic">
<StackPanel Orientation="Vertical" Margin="0,20,0,20">
<!--<HyperlinkButton Content="{x:Bind Name}" NavigateUri="{x:Bind FirstURL}"/>-->
<TextBlock x:Name="firstUrl" Text="{x:Bind FirstURL}"/>
<TextBlock x:Name="text" Text="{x:Bind Text}"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</ScrollViewer>
</Grid>
</Page>