In This Article

BooleanAndConverter Class

Represents a multi-value converter that performs a logical AND (&&) operation on one or more bool values passed to the associated MultiBinding object.

public class BooleanAndConverter
Inheritance:
object object

Remarks

This converter expects all the source values to be of type bool.

Examples

<MultiBinding Converter="{StaticResource BooleanAndConverter}">
    <Binding Path="BooleanValue1" />
    <Binding Path="BooleanValue2" />
    <Binding Path="BooleanValue3" />
</MultiBinding>

Constructors

BooleanAndConverter()

Initializes an instance of the class.

public BooleanAndConverter()

Methods

Convert(object[], Type, object, CultureInfo)

Converts source bool values to a a single bool value by AND-ing the values together.

public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
Parameter Type Description
values object[]

The array of values that the source bindings in the MultiBinding produces. The value System.Windows.DependencyProperty.UnsetValue indicates that the source binding has no value to provide for conversion.

targetType Type

The type of the binding target property.

parameter object

The converter parameter to use.

culture CultureInfo

The culture to use in the converter.

Returns

object:

The result of AND-ing all the source bool values.

ConvertBack(object, Type[], object, CultureInfo)

Converts a binding target value to the source binding values.

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
Parameter Type Description
value object

The value that the binding target produces.

targetTypes Type[]

The array of types to convert to. The array length indicates the number and types of values that are suggested for the method to return.

parameter object

The converter parameter to use.

culture CultureInfo

The culture to use in the converter.

Returns

object[]:

An array of values that have been converted from the target value back to the source values.

Inherited Members