public Convert ( object values, |
||
values | object | The array of values that the source bindings in the |
targetType | The type of the binding target property. | |
parameter | object | The converter parameter to use. |
culture | The culture to use in the converter. | |
return | object |
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (targetType != typeof(bool))
{
throw new InvalidOperationException("The target must be a boolean");
}
if ((int)values[0] == 0)
{
return false;
}
if (values[1] == DependencyProperty.UnsetValue)
{
return true;
}
return !(bool)values[1];
}