XAML-Map-Control/MapControl/MapItemsControl.cs

37 lines
1.1 KiB
C#
Raw Normal View History

// XAML Map Control - http://xamlmapcontrol.codeplex.com/
2012-05-04 12:52:20 +02:00
// Copyright © 2012 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINRT
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 updates the IsCurrent attached property 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
}
}