Binding |
A Binding obtains the value of a property specified by a path and other parameters.
< Button IsVisible="{Binding Path=CurrentElement.IsClickable, Converter=Invert, RelativeSource=SecondaryHand}" />
Path (default) : string
List of properties to access in order to obtain a target value, separated by dots. Can also contain the names to be used in lookups.
{Binding Path=Parameters.Param_Methanol.Value, ElementId=HeatPlate}
In the example above, Parameters and Value are property names, Param_Methanol is the name of the parameter used as key of a Parameters dictionary.
ElementId : string
Id of the element that will be the source of the binding (the object on which the first property of Path will be resolved).
{Binding Path=Parameters.Param_Methanol.Value, ElementId=HeatPlate}
In the example above, the element Parameters property will be taken from the element with the HeatPlate Id.
ItemId : string
Id of the item that will become the source of binding (all items with specified Id become a source, therefore the binding will return multiple values).
{Binding Contents.CurrentContentTypes, ItemId=FalconTube}
In the example above, we bind to all elements with ItemId FalconTube.
Source : object
Source of the binding.
{Binding Path=CurrentElement, Source={RelativeSource AncestorLevel=1}}
In the example above, we bind to the parent's CurrentElement property ({RelativeSource AncestorLevel=1} returns the parent of the element with binding, which then becomes the source of the binding).
RelativeSource : string
Source of a binding specified as one of predefined values.
Allowed values:
{Binding CurrentElement.Contents.CurrentContentTypes, RelativeSource=PrimaryHand}
Converter : IValueConverter
Converter that will be called every time the binding value is retrieved.
Allowed values:
{Binding ActiveStates, Converter=Contains, ConverterParameter=N2}
ConverterParameter : object
Parameter to be used by the converter.
StringFormat : string
Format string to be used for binding value.
{Binding Parameters.Stirrerrate.Value, StringFormat={0:0}%, ElementId=FermentorLiquid}