Class InvertExtension
XAML extension to invert the Value property using the current IValueInverter. Supports every MarkupExtension e.g., BindingBase.
Inherited Members
Namespace: BionicCode.Utilities.Net
Assembly: BionicCode.Utilities.Net.Wpf.dll
Syntax
public class InvertExtension : MarkupExtension
Examples
Provide the value locally or via data binding:
<TextBox Text="{Invert True}" /> // returns: False
<TextBox Text="{Invert 12}" /> // returns: -12
<TextBox Text="{Invert {x:Static Visibility.Hidden}}" /> // returns: Visibility.Visible
<TextBox Text="{Invert {Binding TextValue}}" />
Constructors
| Improve this Doc View SourceInvertExtension()
Default constructor.
Declaration
public InvertExtension()
InvertExtension(Object)
Constructor.
Declaration
public InvertExtension(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | value | Any value that can be converted by the provided ValueInverter. Can be any MarkupExtension like BindingBase that can provide a valid value. |
Properties
| Improve this Doc View SourceMode
The inversion mode.
Declaration
public InversionMode Mode { get; set; }
Property Value
| Type | Description |
|---|---|
| InversionMode | A value of InversionMode. |
Value
The Value to invert. Can everything that the provided ValueInverter can invert. The value can also be a BindingBase or any other MarkupExtension that can provide the invertible value.
Declaration
public object Value { get; set; }
Property Value
| Type | Description |
|---|---|
| Object | The value to invert. |
ValueInverter
The implementation of IValueInverter.
Declaration
public IValueInverter ValueInverter { get; set; }
Property Value
| Type | Description |
|---|---|
| IValueInverter | An implementation of IValueInverter to ise for the conversion. |
Methods
| Improve this Doc View SourceGetValueToInvertFromMarkupExtension(MarkupExtension, IServiceProvider)
Extracts the value from a MarkupExtension.
Declaration
protected object GetValueToInvertFromMarkupExtension(MarkupExtension wrappedMarkupExtension, IServiceProvider serviceProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| MarkupExtension | wrappedMarkupExtension | The MarkupExtension to extract the value form. |
| IServiceProvider | serviceProvider | The instance of the IServiceProvider which was passed to the ProvideValue(IServiceProvider) override. |
Returns
| Type | Description |
|---|---|
| Object | The value of |
ProvideValue(IServiceProvider)
Declaration
public override object ProvideValue(IServiceProvider serviceProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceProvider | serviceProvider |
Returns
| Type | Description |
|---|---|
| Object |