mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-18 12:55:14 +00:00
MapItemsControl SelectionChanged handling in sample applications
This commit is contained in:
parent
f78e7e73c4
commit
70bc9b89ac
7 changed files with 25 additions and 3 deletions
|
|
@ -19,6 +19,7 @@
|
|||
<map:MapItemsControl ItemsSource="{Binding Pushpins}"
|
||||
SelectedItem="{Binding SelectedPushpin}"
|
||||
SelectionMode="Multiple"
|
||||
SelectionChanged="MapItemsControlSelectionChanged"
|
||||
DoubleTapped="MapItemsControlDoubleTapped">
|
||||
<map:MapItemsControl.Styles>
|
||||
<Style Selector="map|MapItem">
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ using Avalonia.Media;
|
|||
using MapControl;
|
||||
using MapControl.UiTools;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace SampleApplication
|
||||
{
|
||||
|
|
@ -72,6 +74,11 @@ namespace SampleApplication
|
|||
|
||||
partial void AddTestLayers();
|
||||
|
||||
private void MapItemsControlSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
Debug.WriteLine("SelectedItems: " + string.Join(", ", ((MapItemsControl)sender).SelectedItems.OfType<PointItem>().Select(item => item.Name)));
|
||||
}
|
||||
|
||||
private void MapItemsControlDoubleTapped(object sender, TappedEventArgs e)
|
||||
{
|
||||
e.Handled = true; // prevent MapDoubleTapped
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue