I suggest you ...

Using C# expressions in WPF bindings

Consider that my ViewModel has the IsBusy propery. It was great if I was able to do binding like this:

<ProgressBar Visiblity="{Binding IsBusy}" ... />
<Button Visiblity="{Binding !IsBusy}" .../>

Note that I've bound Button's visibility to !IsBusy (Not Busy).

I used to have this on JavaScript MVVM frameworks like knockout.

The expression could be more complex like:

<Button Text="IsBusy && !HasError ? true : false"/>

Currently I should use ValueConverters for this which is hard to create, for each type of binding required.

9 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Mehran Davoudi shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base