Show / Hide Table of Contents

Class FlagEnumToBooleanConverter

Converts an enumeration to a boolean if the given enum value has the flag provided by the converter parameter.

Inheritance
object
MarkupExtension
FlagEnumToBooleanConverter
Implements
IValueConverter
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Presentation.Converter
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class FlagEnumToBooleanConverter : MarkupExtension, IValueConverter

Methods

View Source

Convert(object, Type, object, CultureInfo)

Convert a value. Called when moving a value from source to target.

Declaration
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
Type Name Description
object value

value as produced by source binding

Type targetType

target type

object parameter

converter parameter

CultureInfo culture

culture information

Returns
Type Description
object

Converted value. System.Windows.DependencyProperty.UnsetValue may be returned to indicate that the converter produced no value and that the fallback (if available) or default value should be used instead. Binding.DoNothing may be returned to indicate that the binding should not transfer the value or use the fallback or default value.

Remarks

The data binding engine does not catch exceptions thrown by a user-supplied converter. Thus any exception thrown by Convert, or thrown by methods it calls and not caught by the Convert, will be treated as a runtime error (i.e. a crash). Convert should handle anticipated problems by returning DependencyProperty.UnsetValue.

View Source

ConvertBack(object, Type, object, CultureInfo)

Convert back a value. Called when moving a value from target to source. This should implement the inverse of Convert.

Declaration
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
Type Name Description
object value

value, as produced by target

Type targetType

target type

object parameter

converter parameter

CultureInfo culture

culture information

Returns
Type Description
object

Converted back value. Binding.DoNothing may be returned to indicate that no value should be set on the source property. System.Windows.DependencyProperty.UnsetValue may be returned to indicate that the converter is unable to provide a value for the source property, and no value will be set to it.

Remarks

The data binding engine does not catch exceptions thrown by a user-supplied converter. Thus any exception thrown by ConvertBack, or thrown by methods it calls and not caught by the ConvertBack, will be treated as a runtime error (i.e. a crash). ConvertBack should handle anticipated problems by returning DependencyProperty.UnsetValue.

View Source

ProvideValue(IServiceProvider)

Returns the FlagEnumToBooleanConverter.

Declaration
public override object ProvideValue(IServiceProvider serviceProvider)
Parameters
Type Name Description
IServiceProvider serviceProvider

A service provider helper that can provide services for the markup extension.

Returns
Type Description
object

A FlagEnumToBooleanConverter.

Overrides
MarkupExtension.ProvideValue(IServiceProvider)

Implements

IValueConverter

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)

See Also

MarkupExtension
IValueConverter
  • View Source
Back to top Generated by DocFX