NmeaParser/src/SampleApp.WinDesktop/View2D.xaml

76 lines
4 KiB
Plaintext
Raw Normal View History

<UserControl x:Class="SampleApp.WinDesktop.View2D"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SampleApp.WinDesktop"
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
mc:Ignorable="d">
<Grid>
<!--Map-->
<esri:MapView x:Name="mapView" Grid.Row="1">
<local:RestoreAutoPanMode.RestoreAutoPanSettings>
2020-07-29 06:07:32 +02:00
<local:RestoreAutoPanMode DelayInSeconds="2.5" PanMode="Recenter" IsEnabled="True" RestoreScale="5000" />
</local:RestoreAutoPanMode.RestoreAutoPanSettings>
</esri:MapView>
<!--North arrow-->
<Grid Width="50" Height="50" HorizontalAlignment="Right" VerticalAlignment="Bottom"
Margin="20" RenderTransformOrigin=".5,.5">
<Grid.Resources>
<local:ReverseConverter x:Key="conv" />
</Grid.Resources>
<Grid.Effect>
<DropShadowEffect Direction="0" ShadowDepth="0"
BlurRadius="10" Opacity=".75" />
</Grid.Effect>
<Grid.RenderTransform>
<RotateTransform Angle="{Binding ElementName=mapView, Path=MapRotation, Converter={StaticResource conv}}" />
</Grid.RenderTransform>
<TextBlock Text="Ù" FontFamily="Wingdings" HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="40" Foreground="White" />
<TextBlock Text="N" HorizontalAlignment="Center" VerticalAlignment="Top"
FontSize="12" Margin="0,-5,0,0" RenderTransformOrigin=".5,.5"
Foreground="White" >
<TextBlock.RenderTransform>
<RotateTransform Angle="{Binding ElementName=mapView, Path=MapRotation}" />
</TextBlock.RenderTransform>
</TextBlock>
</Grid>
<Grid HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="10" Background="White" Width="150"
DataContext="{Binding ElementName=mapView, Path=LocationDisplay.Location}">
<Grid.Effect>
<DropShadowEffect Direction="0" ShadowDepth="0"
BlurRadius="10" Opacity=".75" />
</Grid.Effect>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Background="CornflowerBlue" Grid.ColumnSpan="2" Padding="10">
<TextBlock Text="Details" FontSize="20" FontWeight="Bold" Foreground="White" />
</Border>
<StackPanel Margin="10" Grid.Row="1">
<TextBlock Text="Speed:" FontWeight="Bold" />
<TextBlock Text="Course:" FontWeight="Bold" />
<TextBlock Text="Altitude:" FontWeight="Bold" />
<TextBlock Text="Accuracy:" FontWeight="Bold" />
</StackPanel>
<StackPanel Margin="0,10,10,10" Grid.Column="1" Grid.Row="1">
<TextBlock Text="{Binding Velocity, StringFormat='{}{0} km/h'}" />
<TextBlock Text="{Binding Course, StringFormat='{}{0}°'}" />
<TextBlock Text="{Binding Position.Z, StringFormat='{}{0} m'}" />
<TextBlock Text="{Binding HorizontalAccuracy, StringFormat='{}{0} m'}" />
</StackPanel>
<local:AltitudeGraph Grid.Row="2" Grid.ColumnSpan="2" Height="50" x:Name="altitude" Value="{Binding Position.Z}" />
</Grid>
</Grid>
</UserControl>