2

Is it possible to pass the current DataContext as a parameter to a MultiBinding?

<Checkbox.IsEnabled>
    <MultiBinding Converter={...}>
        <Binding Path="SomeProperty" Mode="TwoWay"/>
        <Binding Path="DataContext?" Mode="OneWay"/>
    </MultiBinding>
<Checkbox.IsEnabled>
1
  • 1
    Can't you just put an empty string? Because usually you use {binding} to refer to the current datacontext. Commented Mar 8, 2016 at 20:13

1 Answer 1

3

Just use . as Path.

<Binding Path="." Mode="OneWay"/>

Or ignore the Path property alltogether.

<Binding Mode="OneWay"/>

From the Binding.Path documentation:

Optionally, a period (.) path can be used to bind to the current source.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.