Avalonia sample application

This commit is contained in:
ClemensFischer 2024-05-29 20:29:45 +02:00
parent 00e35cfb8a
commit 24c6a70ec7
2 changed files with 7 additions and 1 deletions

View file

@ -16,7 +16,8 @@
ManipulationModes="All"
DoubleTapped="OnMapDoubleTapped">
<map:MapItemsControl ItemsSource="{Binding Pushpins}">
<map:MapItemsControl ItemsSource="{Binding Pushpins}"
DoubleTapped="OnMapItemsControlDoubleTapped">
<map:MapItemsControl.Styles>
<Style Selector="map|MapItem">
<Setter Property="map:MapPanel.Location" Value="{Binding Location}"/>

View file

@ -72,6 +72,11 @@ namespace SampleApplication
partial void AddTestLayers();
private void OnMapItemsControlDoubleTapped(object sender, TappedEventArgs e)
{
e.Handled = true; // prevent OnMapDoubleTapped
}
private void OnMapDoubleTapped(object sender, TappedEventArgs e)
{
map.TargetCenter = map.ViewToLocation(e.GetPosition(map));