SimpleOrientationSensor sample

This sample shows how to use the Windows.Devices.Sensors.SimpleOrientationSensor API.

 
 
 
 
 
5 Star
(2)
10,637 times
Add to favorites
4/2/2014
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C++
C#
JavaScript
<!-- Copyright (c) Microsoft. All rights reserved. -->
<Page
    x:Class="SDKSample.ScenarioList"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SDKSample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    NavigationCacheMode="Enabled">
    
    <Grid x:Name="RootGrid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,0,0,28">
            <StackPanel Orientation="Horizontal">
                <Image Source="Assets/windows-sdk.png" Stretch="None"/>
                <TextBlock Text="Windows platform sample" Style="{StaticResource TagLineTextStyle}" Margin="12,0" />
            </StackPanel>
            <TextBlock x:Name="SampleTitle" Text="Sample title here" Margin="9,-7,0,0" Style="{StaticResource SampleHeaderTextStyle}" TextWrapping="Wrap"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <ListBox x:Name="ScenarioControl" Margin="0,0,0,10" SelectionChanged="ScenarioControl_SelectionChanged" 
                     Background="Transparent" BorderBrush="Transparent" MaxHeight="500" 
                     ScrollViewer.VerticalScrollMode="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"
                     ScrollViewer.HorizontalScrollMode="Disabled">
            </ListBox>
            <Grid Grid.Row="2" Margin="0,0,0,0">
                <Image Source="Assets/microsoft-sdk.png" Stretch="None" HorizontalAlignment="Left"/>
                <TextBlock Text="&#xA9; Microsoft Corporation. All rights reserved." Margin="0,10,0,0" FontSize="12" HorizontalAlignment="Right"/>
            </Grid>
            <StackPanel x:Name="FooterPanel" Orientation="Horizontal" Grid.Row="3" HorizontalAlignment="Right" Margin="0,0,0,10">
                <HyperlinkButton Content="Terms of use" Tag="http://www.microsoft.com/About/Legal/EN/US/IntellectualProperty/Copyright/default.aspx"
                                 Click="Footer_Click" FontSize="12" Style="{StaticResource HyperlinkStyle}"/>
                <TextBlock Text="|" Style="{StaticResource SeparatorStyle}" VerticalAlignment="Center"/>
                <HyperlinkButton Content="Trademarks" Tag="http://www.microsoft.com/About/Legal/EN/US/IntellectualProperty/Trademarks/EN-US.aspx"
                                 Click="Footer_Click" FontSize="12" Style="{StaticResource HyperlinkStyle}"/>
                <TextBlock Text="|"  Style="{StaticResource SeparatorStyle}" VerticalAlignment="Center"/>
                <HyperlinkButton Content="Privacy Statement" Tag="http://privacy.microsoft.com" 
                                 Click="Footer_Click" FontSize="12" Style="{StaticResource HyperlinkStyle}"/>
            </StackPanel>
        </Grid>
    </Grid>
</Page>