Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 42663b3d24
Fetching contributors…

Cannot retrieve contributors at this time

97 lines (87 sloc) 5.611 kb
<common:LayoutAwarePage
x:Name="pageRoot"
x:Class="MashapeOAuthRTExample.MainPage"
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MashapeOAuthRTExample"
xmlns:common="using:MashapeOAuthRTExample.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
<x:String x:Key="AppName">Mashape FB Sentiment Example</x:String>
<DataTemplate x:Key="DataTemplate1">
<StackPanel Orientation="Horizontal">
<Border Width="10" />
<Image Height="50" Width="50">
<Image.Source>
<BitmapImage UriSource="{Binding photo}" />
</Image.Source>
</Image>
<Border Width="10" />
<TextBlock Text="{Binding text}" TextWrapping="Wrap" Width="450"/>
<Border Width="10" />
<TextBlock Text="{Binding handle}" />
</StackPanel>
</DataTemplate>
</Page.Resources>
<!--
This grid acts as a root panel for the page that defines two rows:
* Row 0 contains the back button and page title
* Row 1 contains the rest of the page layout
-->
<Grid Style="{StaticResource LayoutRootStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="140"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Back button and page title -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
<TextBlock x:Name="pageTitle" Grid.Column="1" Text="{StaticResource AppName}" Style="{StaticResource PageHeaderTextStyle}"/>
<ProgressRing x:Name="progressRing" Grid.Column="1" HorizontalAlignment="Left" Margin="795,56,0,0" VerticalAlignment="Top" Height="48" Width="50" Foreground="#FF579CFF"/>
</Grid>
<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"/>
<ListView x:Name="listViewResult" ItemsSource="{Binding}" ItemTemplate="{StaticResource DataTemplate1}" Margin="44,40,666,48" Grid.Row="1" BorderThickness="1" Visibility="Collapsed" SelectionChanged="listViewResult_SelectionChanged"/>
<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">
<StackPanel HorizontalAlignment="Left" Height="539" VerticalAlignment="Top" Width="519" Margin="0,0,0,-1">
<Border BorderThickness="1" Height="20"/>
<TextBlock x:Name="textResult" HorizontalAlignment="Left" Margin="29,0,-114,0" TextWrapping="Wrap" Text="Result" VerticalAlignment="Top" Height="55" Width="185" FontSize="36"/>
<Border BorderThickness="1" Height="30"/>
<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"/>
</StackPanel>
</Border>
<VisualStateManager.VisualStateGroups>
<!-- Visual states reflect the application's view state -->
<VisualStateGroup x:Name="ApplicationViewStates">
<VisualState x:Name="FullScreenLandscape"/>
<VisualState x:Name="Filled"/>
<!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
<VisualState x:Name="FullScreenPortrait">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<!-- The back button and title have different styles when snapped -->
<VisualState x:Name="Snapped">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</common:LayoutAwarePage>
Jump to Line
Something went wrong with that request. Please try again.