Click or drag to resize

InvertExtension Class

XAML extension to invert the Value property using the current IValueInverter. Supports every MarkupExtension e.g., BindingBase.
Inheritance Hierarchy
SystemObject
  System.Windows.MarkupMarkupExtension
    BionicCode.Utilities.Net.Core.Wpf.MarkupInvertExtension

Namespace:  BionicCode.Utilities.Net.Core.Wpf.Markup
Assembly:  BionicCode.Utilities.Net.Core.Wpf (in BionicCode.Utilities.Net.Core.Wpf.dll) Version: 1.0.2
Syntax
public class InvertExtension : MarkupExtension

The InvertExtension type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyMode
The inversion mode.
Public propertyValue
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.
Public propertyValueInverter
The implementation of IValueInverter.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodGetValueToInvertFromMarkupExtension
Extracts the value from a MarkupExtension.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodProvideValue
When implemented in a derived class, returns an object that is provided as the value of the target property for this markup extension.
(Overrides MarkupExtensionProvideValue(IServiceProvider).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
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}}" />

See Also
https://github.com/BionicCode/BionicCode.Net/blob/master/README.md