mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Added MapBase.MapLayerItemsSource property
This commit is contained in:
parent
0b5d1e439f
commit
2194f08a74
6 changed files with 275 additions and 70 deletions
|
|
@ -5,8 +5,6 @@ using Windows.UI.Xaml;
|
|||
using Microsoft.UI.Xaml;
|
||||
#endif
|
||||
|
||||
#pragma warning disable IDE0060 // Remove unused parameter
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public static class DependencyPropertyHelper
|
||||
|
|
@ -15,8 +13,7 @@ namespace MapControl
|
|||
string name,
|
||||
Type ownerType,
|
||||
TValue defaultValue = default,
|
||||
Action<FrameworkElement, TValue, TValue> changed = null,
|
||||
bool inherits = false) // unused in WinUI/UWP
|
||||
Action<FrameworkElement, TValue, TValue> changed = null)
|
||||
{
|
||||
var metadata = changed == null
|
||||
? new PropertyMetadata(defaultValue)
|
||||
|
|
|
|||
22
MapControl/WinUI/TileSourceConverter.cs
Normal file
22
MapControl/WinUI/TileSourceConverter.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
#if UWP
|
||||
using Windows.UI.Xaml.Data;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public class TileSourceConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
return TileSource.Parse(value.ToString());
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue