Skip to content
Newer
Older
100644 97 lines (87 sloc) 5.48 KB
50ca9b3 @ismaelc Initial commit
authored
1 <common:LayoutAwarePage
2 x:Name="pageRoot"
3 x:Class="MashapeOAuthRTExample.MainPage"
4 DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
5 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
6 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
7 xmlns:local="using:MashapeOAuthRTExample"
8 xmlns:common="using:MashapeOAuthRTExample.Common"
9 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
10 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
11 mc:Ignorable="d">
12
13 <Page.Resources>
14
15 <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
16 <x:String x:Key="AppName">Mashape FB Sentiment Example</x:String>
17
18 <DataTemplate x:Key="DataTemplate1">
19 <StackPanel Orientation="Horizontal">
20 <Border Width="10" />
21 <Image Height="50" Width="50">
22 <Image.Source>
23 <BitmapImage UriSource="{Binding photo}" />
24 </Image.Source>
25 </Image>
26 <Border Width="10" />
27 <TextBlock Text="{Binding text}" TextWrapping="Wrap" Width="450"/>
28 <Border Width="10" />
29 <TextBlock Text="{Binding handle}" />
30 </StackPanel>
31 </DataTemplate>
32 </Page.Resources>
33
34 <!--
35 This grid acts as a root panel for the page that defines two rows:
36 * Row 0 contains the back button and page title
37 * Row 1 contains the rest of the page layout
38 -->
39 <Grid Style="{StaticResource LayoutRootStyle}">
40 <Grid.RowDefinitions>
41 <RowDefinition Height="140"/>
42 <RowDefinition Height="*"/>
43 </Grid.RowDefinitions>
44
45 <!-- Back button and page title -->
46 <Grid>
47 <Grid.ColumnDefinitions>
48 <ColumnDefinition Width="Auto"/>
49 <ColumnDefinition Width="*"/>
50 </Grid.ColumnDefinitions>
51 <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
52 <TextBlock x:Name="pageTitle" Grid.Column="1" Text="{StaticResource AppName}" Style="{StaticResource PageHeaderTextStyle}"/>
53 <ProgressRing x:Name="progressRing" Grid.Column="1" HorizontalAlignment="Left" Margin="795,56,0,0" VerticalAlignment="Top" Height="48" Width="50" Foreground="#FF579CFF"/>
54 </Grid>
55 <Button x:Name="btnLogin" Content="Login" HorizontalAlignment="Left" Margin="125,80,0,0" Grid.Row="1" VerticalAlignment="Top" Height="100" Width="235" FontSize="24" Click="btnLogin_Click"/>
56 <ListView x:Name="listViewResult" ItemsSource="{Binding}" ItemTemplate="{StaticResource DataTemplate1}" Margin="44,40,666,48" Grid.Row="1" BorderThickness="1" Visibility="Collapsed" SelectionChanged="listViewResult_SelectionChanged"/>
57 <Border x:Name="borderSentimentResult" BorderBrush="White" BorderThickness="1" HorizontalAlignment="Left" Height="540" Margin="750,40,0,0" Grid.Row="1" VerticalAlignment="Top" Width="530" Visibility="Collapsed">
58 <StackPanel HorizontalAlignment="Left" Height="539" VerticalAlignment="Top" Width="519" Margin="0,0,0,-1">
59 <Border BorderThickness="1" Height="20"/>
60 <TextBlock x:Name="textResult" HorizontalAlignment="Left" Margin="29,0,-114,0" TextWrapping="Wrap" Text="Result" VerticalAlignment="Top" Height="55" Width="185" FontSize="36"/>
61 <Border BorderThickness="1" Height="30"/>
62 <TextBox x:Name="textBoxResult" TextWrapping="Wrap" Text="Click/Tap message on the left to check sentiment analysis..." Height="324" Margin="29,0,30,0" FontSize="36"/>
63 </StackPanel>
64 </Border>
65
66 <VisualStateManager.VisualStateGroups>
67
68 <!-- Visual states reflect the application's view state -->
69 <VisualStateGroup x:Name="ApplicationViewStates">
70 <VisualState x:Name="FullScreenLandscape"/>
71 <VisualState x:Name="Filled"/>
72
73 <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
74 <VisualState x:Name="FullScreenPortrait">
75 <Storyboard>
76 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
77 <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
78 </ObjectAnimationUsingKeyFrames>
79 </Storyboard>
80 </VisualState>
81
82 <!-- The back button and title have different styles when snapped -->
83 <VisualState x:Name="Snapped">
84 <Storyboard>
85 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
86 <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
87 </ObjectAnimationUsingKeyFrames>
88 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
89 <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
90 </ObjectAnimationUsingKeyFrames>
91 </Storyboard>
92 </VisualState>
93 </VisualStateGroup>
94 </VisualStateManager.VisualStateGroups>
95 </Grid>
96 </common:LayoutAwarePage>
Something went wrong with that request. Please try again.