Version 4.14. Added support for .NET Core 3

This commit is contained in:
ClemensF 2019-09-27 22:13:10 +02:00
parent a4fad94921
commit 23778280e1
35 changed files with 797 additions and 36 deletions

View file

@ -0,0 +1,36 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using MapControl;
namespace WpfCoreApp
{
public class LocationToVisibilityConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
var visibility = Visibility.Hidden;
if (values.Length == 2 && values[0] is MapBase && values[1] is Point?)
{
var parentMap = (MapBase)values[0];
var position = (Point?)values[1];
if (position.HasValue &&
position.Value.X >= 0d && position.Value.X <= parentMap.ActualWidth &&
position.Value.Y >= 0d && position.Value.Y <= parentMap.ActualHeight)
{
visibility = Visibility.Visible;
}
}
return visibility;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
}