XAML-Map-Control/SampleApps/SampleApplication/MapBackgroundConverter.cs
2012-07-04 17:19:48 +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();
}
}
}