AvaloniaUI: Logic in xaml

1k views Asked by At

Can I use logic in xaml e.g.

IsVisible="{Binding OnlyTraverseSelectedSection != null ? true : false}"

in some way?

1

There are 1 answers

2
Grokys On

You can't currently use expressions in bindings - I would love for that to be the case but we're not there yet!

Having said that, there is one kind-of expression you can use in binding - the negation operator:

https://github.com/AvaloniaUI/Avalonia/blob/master/docs/spec/binding-from-xaml.md#negating-bindings

An example:

<TextBox IsEnabled="{Binding !HasErrors}"/>