XAML-Map-Control/MapControl/TileLayerCollection.cs
2015-01-20 17:52:02 +01:00

22 lines
628 B
C#

// XAML Map Control - http://xamlmapcontrol.codeplex.com/
// © 2015 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using System.Collections.ObjectModel;
using System.Linq;
namespace MapControl
{
/// <summary>
/// A collection of TileLayers with a string indexer that allows
/// to retrieve individual TileLayers by their SourceName property.
/// </summary>
public class TileLayerCollection : Collection<TileLayer>
{
public TileLayer this[string sourceName]
{
get { return this.FirstOrDefault(t => t.SourceName == sourceName); }
}
}
}