XAML-Map-Control/MapControl/Shared/MapItemsControl.cs

57 lines
1.3 KiB
C#
Raw Normal View History

// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
// © 2018 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
2017-09-05 20:57:17 +02:00
#if WINDOWS_UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using KeyEventArgs = Windows.UI.Xaml.Input.KeyRoutedEventArgs;
2017-09-05 20:57:17 +02:00
#else
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
2017-09-05 20:57:17 +02:00
#endif
namespace MapControl
{
/// <summary>
2017-09-05 20:57:17 +02:00
/// Container class for an item in a MapItemsControl.
/// </summary>
public class MapItem : ListBoxItem
{
public MapItem()
{
DefaultStyleKey = typeof(MapItem);
MapPanel.InitMapElement(this);
}
}
/// <summary>
/// Manages a collection of selectable items on a Map.
/// </summary>
public class MapItemsControl : ListBox
{
public MapItemsControl()
{
DefaultStyleKey = typeof(MapItemsControl);
2017-09-05 20:57:17 +02:00
MapPanel.InitMapElement(this);
}
protected override DependencyObject GetContainerForItemOverride()
{
return new MapItem();
}
protected override bool IsItemItsOwnContainerOverride(object item)
{
return item is MapItem;
}
protected override void OnKeyDown(KeyEventArgs e)
{
}
}
}