Class DefaultValueInverter
Class that inverts a value. Supports inversion of Byte, Int32, Double, Decimal, Single, Boolean and Visibility.
This class can be used with the InvertExtension.
Implements
Inherited Members
Namespace: BionicCode.Utilities.Net
Assembly: BionicCode.Utilities.Net.Wpf.dll
Syntax
public class DefaultValueInverter : IValueInverter
Remarks
The DefaultValueInverter will check if the value is of type string. The string representation is then converted to the native type, inverted and then converted back to string using the provided ToString() implementation provided by the native type.
Methods
| Improve this Doc View SourceInvertValue(Object)
Throws an exception if operation has failed.
Declaration
public object InvertValue(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | value |
Returns
| Type | Description |
|---|---|
| Object | The inverted value. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException |
TryInvertValue(Object, out Object)
Trys to invert a value. Won't throw an exception if operation fails.
Declaration
public bool TryInvertValue(object value, out object invertedValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | value | |
| Object | invertedValue |
Returns
| Type | Description |
|---|---|
| Boolean |
|