mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 06:26:41 +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
|
|
@ -137,7 +137,8 @@
|
|||
<map:MapItemsControl ItemContainerStyle="{StaticResource PushpinItemStyle}"
|
||||
ItemsSource="{Binding Pushpins}"
|
||||
SelectedItem="{Binding SelectedPushpin}"
|
||||
SelectionMode="Multiple"/>
|
||||
SelectionMode="Multiple"
|
||||
SelectionChanged="MapItemsControlSelectionChanged"/>
|
||||
|
||||
<map:Pushpin AutoCollapse="True" Location="65,-18" Content="Iceland"/>
|
||||
<map:Pushpin AutoCollapse="True" Location="71,25" Content="Norway"/>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using System.Globalization;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
|
||||
|
|
@ -20,7 +21,7 @@ namespace SampleApplication
|
|||
//TileImageLoader.Cache = new MapControl.Caching.SQLiteCache(TileImageLoader.DefaultCacheFolder);
|
||||
//TileImageLoader.Cache = new RedisCache(Options.Create(new RedisCacheOptions
|
||||
//{
|
||||
// Configuration = "localhost:6379",
|
||||
// Configuration = "T400:6379",
|
||||
// InstanceName = "MapTileCache/"
|
||||
//}));
|
||||
|
||||
|
|
@ -82,6 +83,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 ResetHeadingButtonClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
map.TargetHeading = 0d;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue