Added Heading Reset Button to sample applications

This commit is contained in:
Clemens 2021-12-06 17:54:46 +01:00
parent e3167b3e2c
commit f478bf5c3b
8 changed files with 107 additions and 19 deletions

View file

@ -1,9 +1,8 @@
<Window
x:Class="SampleApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="using:MapControl"
xmlns:local="using:SampleApplication">
<Window x:Class="SampleApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="using:MapControl"
xmlns:local="using:SampleApplication">
<Grid>
<Grid.Resources>
@ -85,8 +84,8 @@
<local:MapViewModel/>
</Grid.DataContext>
<map:Map x:Name="map"
MinZoomLevel="2" MaxZoomLevel="21" ZoomLevel="11" MouseWheelZoomDelta="1"
<map:Map x:Name="map" ManipulationMode="All"
MinZoomLevel="2" MaxZoomLevel="21" ZoomLevel="11"
MapLayer="{Binding MapLayers[OpenStreetMap]}"
PointerMoved="MapPointerMoved"
PointerExited="MapPointerExited">
@ -132,6 +131,17 @@
Minimum="{Binding MinZoomLevel, ElementName=map}"
Maximum="{Binding MaxZoomLevel, ElementName=map}"
Value="{Binding TargetZoomLevel, ElementName=map, Mode=TwoWay}"/>
<Button Margin="2" Padding="8" ToolTipService.ToolTip="Reset Heading" Click="ResetHeadingButtonClick">
<Button.Visibility>
<Binding Path="Heading" ElementName="map">
<Binding.Converter>
<local:HeadingToVisibilityConverter/>
</Binding.Converter>
</Binding>
</Button.Visibility>
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xEBE6;"/>
</Button>
</StackPanel>
<Border HorizontalAlignment="Center" VerticalAlignment="Top" Margin="4"