mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
62 lines
1.7 KiB
C#
62 lines
1.7 KiB
C#
using System;
|
|
#if UWP
|
|
using Windows.UI.Xaml.Data;
|
|
#elif WINUI
|
|
using Microsoft.UI.Xaml.Data;
|
|
#endif
|
|
|
|
namespace MapControl
|
|
{
|
|
public class LocationConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, string language)
|
|
{
|
|
return Location.Parse(value.ToString());
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
|
{
|
|
return value.ToString();
|
|
}
|
|
}
|
|
|
|
public class LocationCollectionConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, string language)
|
|
{
|
|
return LocationCollection.Parse(value.ToString());
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
|
{
|
|
return value.ToString();
|
|
}
|
|
}
|
|
|
|
public class BoundingBoxConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, string language)
|
|
{
|
|
return BoundingBox.Parse(value.ToString());
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
|
{
|
|
return value.ToString();
|
|
}
|
|
}
|
|
|
|
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)
|
|
{
|
|
return value.ToString();
|
|
}
|
|
}
|
|
}
|