MultiBinding |
A MultiBinding accepts a collection and produces a final value based on expression and filters. Output can be either a collection or a result of collection aggregation.
< Field Id="Field_ClickedTubes" Value="{MultiBinding Source={Binding ItemId=Tube}, Filter=Conditional, FilterParameter=${Binding ClickCount, Converter=GreaterThan, ConverterParameter=0}}" />
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. Is used to get a value from each item of a source collection.
Expression: string
Markup extension expression to be created for each item of a source collection. Must start with $ character, which signifies a string literal.
Source: IObservableCollection
Source of the binding. Must be a collection of items.
Filter: IFilter
Filter that can pass or discard items of a collection.
{MultiBinding Source={Binding ItemId=Tube}, Filter={CompositeFilter F1=Conditional, P1=${Binding IsClickable}, F2=Skip, P2=3, F3=Take, P3=2}}
Filter in example above selects all clickable tubes, skips first three and takes first two out of remaining.
Allowed values:
Skip: IFilter
Skips n item(s) from available items.
{MultiBinding Source={Binding ItemId=Tube}, Filter={CompositeFilter F1=Skip, P1=2}}
In the example above, the filter selects all tubes and skips the first two.
Take: IFilter
Takes n item(s) from available items.
{MultiBinding Source={Binding ItemId=Tube}, Filter={CompositeFilter F1=Take, P1=3}}
In the example above, the filter selects all tubes and takes the first three.
Conditional: IFilter
Selects item(s) from available items based on given condition(s).
{MultiBinding Source={Binding ItemId=Tube}, Filter={CompositeFilter F1=Conditional, P1=${Binding IsClickable}}}
In the example above, the filter selects all clickable tubes.
OrderBy: IFilter
Sorts available items in ascending order.
{MultiBinding Source={Binding ItemId=Tube}, Filter={CompositeFilter F1=OrderBy}}
In the example above, the filter sorts all tubes in ascending order.
OrderByDescending: IFilter
Sorts available items in descending order.
{MultiBinding Source={Binding ItemId=Tube}, Filter={CompositeFilter F1=OrderByDescending}}
In the example above, the filter sorts all tubes in descending order.
DescendantElements: IFilter
FilterParameter : object
Parameter to be used by the filter.
Aggregate : Aggregate
A function to be used for aggregation of collection items.
Allowed values:
< Field Id="Field_TubesCount" Value="{MultiBinding Source={Binding ItemId=Tube}, Aggregate=Count}" /> <Field Id="Field_AllTubesClickable" Value="{MultiBinding IsClickable, Source={Binding ItemId=Tube}, Aggregate=AllTrue}" /> <Field Id="Field_AllTubesClickable" Value="{MultiBinding Source={Binding ItemId=Tube}, Filter=Conditional, FilterParameter=${Binding IsClickable, Converter=Invert}, Aggregate=Any}" /> <Field Id="Field_AllTubesClickedAtLeastTwice" Value="{MultiBinding Source={Binding ItemId=Tube}, Expression=${Binding ClickCount, Converter=GreaterThanOrEquals, ConverterParameter=2}, Aggregate=AllTrue}" /> <Field Id="Field_AtLeastOneTubeClickedAtLeastThreeTimes" Value="{MultiBinding Source={Binding ItemId=Tube}, Expression=${Binding ClickCount, Converter=GreaterThan, ConverterParameter=2}, Aggregate=AnyTrue}" />