XAML-Map-Control/MapControl/MapItemsControl.cs

38 lines
1.1 KiB
C#
Raw Normal View History

// XAML Map Control - http://xamlmapcontrol.codeplex.com/
// Copyright © Clemens Fischer 2012-2013
2012-05-04 12:52:20 +02:00
// Licensed under the Microsoft Public License (Ms-PL)
#if NETFX_CORE
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
2012-04-25 22:02:53 +02:00
using System.Windows;
using System.Windows.Controls;
#endif
2012-04-25 22:02:53 +02:00
namespace MapControl
{
2012-05-04 12:52:20 +02:00
/// <summary>
/// Manages a collection of selectable items on a Map. Uses MapItem as container for items
/// and (for WPF only) updates the IsCurrent attached property on each MapItem when the
/// Items.CurrentItem property changes.
2012-05-04 12:52:20 +02:00
/// </summary>
public partial class MapItemsControl : ListBox
2012-04-25 22:02:53 +02:00
{
public UIElement ContainerFromItem(object item)
{
return item != null ? ItemContainerGenerator.ContainerFromItem(item) as UIElement : null;
}
2012-04-25 22:02:53 +02:00
public object ItemFromContainer(DependencyObject container)
{
return container != null ? ItemContainerGenerator.ItemFromContainer(container) : null;
}
protected override DependencyObject GetContainerForItemOverride()
{
return new MapItem();
}
2012-04-25 22:02:53 +02:00
}
}