XAML-Map-Control/TestApplication/MapBackgroundConverter.cs
2012-05-04 12:52:20 +02:00

29 lines
837 B
C#

using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
using MapControl;
namespace MapControlTestApp
{
class MapBackgroundConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
MapBackground mapBackground = (MapBackground)value;
if (parameter as string == "Foreground")
{
return mapBackground == MapBackground.Light ? Brushes.Black : Brushes.White;
}
return mapBackground == MapBackground.Light ? Brushes.White : Brushes.Black;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}