First commit of the new XAML Map Control that replaces WPF Map Control, and now supports all three XAML platforms, WPF, Silverlight and WinRT.

This commit is contained in:
ClemensF 2012-11-22 21:42:29 +01:00
parent c28e9d73d9
commit 27a302a5b8
124 changed files with 6938 additions and 2093 deletions

View file

@ -0,0 +1,36 @@
using MapControl;
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace WpfApplication
{
public class LocationToVisibilityConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
Visibility visibility = Visibility.Hidden;
if (values.Length == 2 && values[0] is Map && values[1] is Transform)
{
Map parentMap = (Map)values[0];
Matrix transform = ((Transform)values[1]).Value;
if (transform.OffsetX >= 0d && transform.OffsetX <= parentMap.ActualWidth &&
transform.OffsetY >= 0d && transform.OffsetY <= parentMap.ActualHeight)
{
visibility = Visibility.Visible;
}
}
return visibility;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
}