<phone:PhoneApplicationPage 
    x:Class="SimpleMotionSample.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <!-- Oberflaeche für die Kalibrierung -->
        <StackPanel Name="CalibrationStackPanel" Background="Black" Opacity="1" Visibility="Collapsed" Grid.Row="1">
            <Image Source="Calibrate_Motion.png" Opacity=".95" HorizontalAlignment="Center"/>
            <TextBlock TextWrapping="Wrap" TextAlignment="Center" Width="459" FontSize="24">Die Montionsensorik Ihres Gerätes muss neu kalibriert werden. Halten Sie hierzu Ihr Gerät vor sich und führen Sie so lange die dargestellte Figur in Bewegung aus, bis die Schaltfläche "Fertig" aktiv wird!</TextBlock>
            <StackPanel Orientation="Horizontal" Margin="0,10" HorizontalAlignment="Center">
                <TextBlock FontWeight="Bold" TextDecorations="Underline" FontSize="22">Genauigkeit:</TextBlock>
                <TextBlock Name="tbx_calibration" FontWeight="Bold" FontSize="26" />
            </StackPanel>
            <Button Name="btn_Calibration" Content="Fertig" Click="btn_Calibration_Click" IsEnabled="False" />
        </StackPanel>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28" Visibility="Visible">
            <TextBlock x:Name="ApplicationTitle" Text="WINDOWS PHONE 7.5" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="Simple Motion" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!-- Oberflaeche für die Messwerte -->
        <Grid x:Name="ValuePanel" Grid.Row="1" Visibility="Collapsed">
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,18,0,0" Name="textBlock7" Text="Zeitstempel:" VerticalAlignment="Top" />
            <TextBox Height="72" HorizontalAlignment="Left" IsReadOnly="True" Margin="177,-7,0,0" Name="tbx_TimeStamp" Text="" VerticalAlignment="Top" Width="297" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,72,0,0" Name="textBlock1" Text="Roll:" VerticalAlignment="Top" />
            <TextBox Height="72" HorizontalAlignment="Left" IsReadOnly="True" Margin="85,47,0,0" Name="tbx_Roll" Text="" VerticalAlignment="Top" Width="389" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,126,0,0" Name="textBlock3" Text="Pitch:" VerticalAlignment="Top" />
            <TextBox Height="72" HorizontalAlignment="Left" IsReadOnly="True" Margin="85,101,0,0" Name="tbx_Pitch" Text="" VerticalAlignment="Top" Width="389" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,0,0,558" Name="textBlock4" Text="Yaw:" VerticalAlignment="Bottom" />
            <TextBox Height="72" HorizontalAlignment="Left" IsReadOnly="True" Margin="85,155,0,0" Name="tbx_Yaw" Text="" VerticalAlignment="Top" Width="389" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,271,0,0" Name="textBlock5" Text="X:" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,307,0,0" Name="textBlock6" Text="Y:" VerticalAlignment="Top" Width="16" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,0,0,395" Name="textBlock8" Text="Z:" VerticalAlignment="Bottom" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,426,0,0" Name="textBlock9" Text="X:" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="14,462,0,0" Name="textBlock10" Text="Y:" VerticalAlignment="Top" Width="16" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,0,0,240" Name="textBlock11" Text="Z:" VerticalAlignment="Bottom" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="14,580,0,0" Name="textBlock12" Text="X:" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="15,616,0,0" Name="textBlock13" Text="Y:" VerticalAlignment="Top" Width="16" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="15,0,0,86" Name="textBlock14" Text="Z:" VerticalAlignment="Bottom" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,544,0,0" Name="textBlock15" Text="Gravitationsvektor:" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,390,0,0" Name="textBlock16" Text="Rotationsgeschwindigkeit:" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="13,234,0,0" Name="textBlock17" Text="Lineare Beschleunigung:" VerticalAlignment="Top" />
            <Button Content="Stoppen" Height="72" HorizontalAlignment="Left" Margin="-6,696,0,0" Name="btn_Stop" VerticalAlignment="Top" Width="480" Click="btn_Stop_Click" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="85,271,0,0" Name="tbl_DeviceAccelerationX" Text="" VerticalAlignment="Top" Width="374" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="85,307,0,0" Name="tbl_DeviceAccelerationY" Text="" VerticalAlignment="Top" Width="374" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="85,343,0,0" Name="tbl_DeviceAccelerationZ" Text="" VerticalAlignment="Top" Width="374" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="85,426,0,0" Name="tbl_DeviceRotationRateX" Text="" VerticalAlignment="Top" Width="374" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="85,462,0,0" Name="tbl_DeviceRotationRateY" Text="" VerticalAlignment="Top" Width="374" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="85,498,0,0" Name="tbl_DeviceRotationRateZ" Text="" VerticalAlignment="Top" Width="374" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="85,580,0,0" Name="tbl_GravityX" Text="" VerticalAlignment="Top" Width="374" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="85,616,0,0" Name="tbl_GravityY" Text="" VerticalAlignment="Top" Width="374" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="85,652,0,0" Name="tbl_GravityZ" Text="" VerticalAlignment="Top" Width="374" />
        </Grid>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" Visibility="Visible">
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="6,6,0,0" Name="textBlock2" Text="Abfrageintervall in ms:" VerticalAlignment="Top" />
            <Slider Height="84" HorizontalAlignment="Left" Margin="0,25,0,0" Name="sld_Interval" VerticalAlignment="Top" Width="456" Value="20" Maximum="1000" Minimum="10" SmallChange="10" LargeChange="10" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="343,6,0,0" Name="tbl_Interval" Text="{Binding ElementName=sld_Interval, Path=Value}" VerticalAlignment="Top" Width="107" TextAlignment="Right" />
            
            <Button Content="Starten" Height="72" HorizontalAlignment="Left" Margin="-12,535,0,0" Name="btn_Start" VerticalAlignment="Top" Width="480" Click="btn_Start_Click" />
        </Grid>
    </Grid>
 
  

</phone:PhoneApplicationPage>