Added MapBase.MapLayerItemsSource property

This commit is contained in:
ClemensFischer 2025-08-11 23:01:22 +02:00
parent 0b5d1e439f
commit 2194f08a74
6 changed files with 275 additions and 70 deletions

View file

@ -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)

View 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();
}
}
}