wpf Binding multiple values with a MultiBinding


Example

The MultiBinding allows binding multiple values to the same property. In the following example multiple values are bound to the Text property of a Textbox and formatted using the StringFormat property.

<TextBlock>
    <TextBlock.Text>
        <MultiBinding StringFormat="{}{0} {1}">
            <Binding Path="User.Forename"/>
            <Binding Path="User.Surname"/>
        </MultiBinding>
    </TextBlock.Text>
</TextBlock>

Apart from StringFormat, an IMultiValueConvertercould also be used to convert the values from the Bindings to one value for the MultiBinding's target.

However, MultiBindings cannot be nested.