4 using System.Globalization;
6 namespace SiliconStudio.Presentation.ValueConverters
15 public override object Convert(
object value, Type targetType,
object parameter, CultureInfo culture)
17 bool result = System.Convert.ToBoolean(value);
18 return result ? parameter : null;
22 public override object ConvertBack(
object value, Type targetType,
object parameter, CultureInfo culture)
This converter will convert a boolean to the object given in parameter if its true, and to null if it's false. ConvertBack is supported and will return whether the given object is non-null
override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
override object Convert(object value, Type targetType, object parameter, CultureInfo culture)