<phone:PhoneApplicationPage 
    x:Class="CompassSample.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>

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

        <!-- Oberflaeche für die Kalibrierung -->
        <StackPanel Name="CalibrationStackPanel" Background="Black" Opacity="1" Visibility="Collapsed" Grid.Row="1">
            <Image Source="Calibrate_Compass.png" Opacity=".95" HorizontalAlignment="Center"/>
            <TextBlock TextWrapping="Wrap" TextAlignment="Center" Width="459" FontSize="24">Der Kompasssensor 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>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" Visibility="Visible">
            <Button Content="Starten" Height="72" HorizontalAlignment="Left" Margin="12,529,0,0" Name="btn_Launch" VerticalAlignment="Top" Width="438" Click="btn_Launch_Click" />
            <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" />
            <TextBox Height="72" HorizontalAlignment="Left" Margin="180,184,0,0" Name="tbx_MagneticHeading" IsReadOnly="True" Text="" VerticalAlignment="Top" Width="270" />
            <TextBox Height="72" HorizontalAlignment="Left" Margin="180,241,0,0" Name="tbx_TrueHeading" Text="" IsReadOnly="True" VerticalAlignment="Top" Width="270" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="6,209,0,0" Name="textBlock1" Text="MagneticHeading:" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="9,266,0,0" Name="textBlock3" Text="TrueHeading:" VerticalAlignment="Top" />
            <TextBox Height="72" HorizontalAlignment="Left" Margin="32,298,0,0" Name="tbx_X" Text="" IsReadOnly="True" VerticalAlignment="Top" Width="97" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="9,320,0,0" Name="textBlock4" Text="X:" VerticalAlignment="Top" />
            <TextBox Height="72" HorizontalAlignment="Left" Margin="180,298,0,0" Name="tbx_Y" Text="" IsReadOnly="True" VerticalAlignment="Top" Width="97" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="157,320,0,0" Name="textBlock5" Text="Y:" VerticalAlignment="Top" />
            <TextBox Height="72" HorizontalAlignment="Left" Margin="343,298,0,0" Name="tbx_Z" Text="" IsReadOnly="True" VerticalAlignment="Top" Width="97" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="320,320,0,0" Name="textBlock6" Text="Z:" VerticalAlignment="Top" />

            <TextBlock Height="30" HorizontalAlignment="Left" Margin="9,95,0,0" Name="textBlock7" Text="Zeitstempel:" VerticalAlignment="Top" />
            <TextBox Height="72" HorizontalAlignment="Right" IsReadOnly="True" Margin="0,127,6,0" Name="tbx_HeadingAccuracy" Text="" VerticalAlignment="Top" Width="270" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="9,152,0,0" Name="textBlock8" Text="Genauigkeit:" VerticalAlignment="Top" />
            <TextBox Height="72" HorizontalAlignment="Left" IsReadOnly="True" Margin="180,70,0,0" Name="tbx_TimeStamp" Text="" VerticalAlignment="Top" Width="270" />
            <Line x:Name="magneticLine" X1="240" Y1="475" X2="240" Y2="395" Stroke="White" StrokeThickness="4"></Line>
            <Line x:Name="trueLine" X1="240" Y1="475" X2="240" Y2="395" Stroke="Gray" StrokeThickness="4"></Line>
            <Line x:Name="xLine" X1="240" Y1="475" X2="340" Y2="475" Stroke="Red" StrokeThickness="4"></Line>
            <Line x:Name="yLine" X1="240" Y1="475" X2="240" Y2="395" Stroke="Green" StrokeThickness="4"></Line>
            <Line x:Name="zLine" X1="240" Y1="475" X2="190" Y2="525" Stroke="Blue" StrokeThickness="4"></Line>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>