WPF Binding FallbackValue set to Binding

What you are looking for is something called PriorityBinding (#6 on this list)

(from the article)

The point to PriorityBinding is to
name multiple data bindings in order
of most desirable to least desirable.
This way if the first binding fails,
is empty and/or default, another
binding can take it’s place.

e.g.

<TextBox>
    <TextBox.Text>
        <PriorityBinding>
            <Binding Path="LastNameNonExistant" IsAsync="True" />
            <Binding Path="FirstName" IsAsync="True" />
        </PriorityBinding>
    </TextBox.Text>
</TextBox>

Leave a Comment