Sample applications DoubleTapped handling

This commit is contained in:
ClemensFischer 2024-05-31 09:17:44 +02:00
parent e8b6d318ec
commit 12a49f0881
4 changed files with 16 additions and 9 deletions

View file

@ -169,13 +169,15 @@
<map:MapItemsControl ItemContainerStyle="{StaticResource PointItemStyle}"
ItemsSource="{Binding Points}"
SelectionMode="Multiple"
LocationMemberPath="Location"/>
LocationMemberPath="Location"
DoubleTapped="MapItemsControlDoubleTapped"/>
<map:MapItemsControl ItemContainerStyle="{StaticResource PushpinItemStyle}"
ItemsSource="{Binding Pushpins}"
SelectedItem="{Binding SelectedPushpin, Mode=TwoWay}"
SelectionMode="Multiple"
LocationMemberPath="Location"/>
LocationMemberPath="Location"
DoubleTapped="MapItemsControlDoubleTapped"/>
<map:MapPath Location="53.5,8.2" Stroke="Blue" StrokeThickness="3" Fill="#1F007F00">
<map:MapPath.Data>

View file

@ -82,9 +82,9 @@ namespace SampleApplication
partial void AddTestLayers();
private void ResetHeadingButtonClick(object sender, RoutedEventArgs e)
private void MapItemsControlDoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
{
map.TargetHeading = 0d;
e.Handled = true; // prevent MapDoubleTapped
}
private void MapDoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
@ -92,6 +92,11 @@ namespace SampleApplication
map.TargetCenter = map.ViewToLocation(e.GetPosition(map));
}
private void ResetHeadingButtonClick(object sender, RoutedEventArgs e)
{
map.TargetHeading = 0d;
}
private async void MapPointerPressed(object sender, PointerRoutedEventArgs e)
{
if (e.Pointer.PointerDeviceType == PointerDeviceType.Mouse)