42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Windows.Data;
|
|||
|
using System.Globalization;
|
|||
|
using System.Windows.Media;
|
|||
|
|
|||
|
namespace SudokuWeek4.Models.Converters
|
|||
|
{
|
|||
|
internal class BorderValueConverter : IValueConverter
|
|||
|
{
|
|||
|
private static readonly BorderValueConverter _instance = new BorderValueConverter();
|
|||
|
|
|||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|||
|
{
|
|||
|
if (value is Boolean && targetType == typeof(Brush))
|
|||
|
{
|
|||
|
Boolean color = (Boolean)value;
|
|||
|
if (color)
|
|||
|
return Brushes.Orange;
|
|||
|
else
|
|||
|
return Brushes.Transparent;
|
|||
|
}
|
|||
|
|
|||
|
// The type is not a brush
|
|||
|
return null;
|
|||
|
}
|
|||
|
|
|||
|
// Create a property to get the instance of the BorderValue
|
|||
|
public static BorderValueConverter Instance
|
|||
|
{
|
|||
|
get { return _instance; }
|
|||
|
}
|
|||
|
|
|||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|||
|
{
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|