Reputation: 35
I am trying to use the BoolConverters.And
converter, but cannot seem to find a way to get it working inside XAML.
Xmlns declaration:
xmlns:acon="clr-namespace:Avalonia.Data.Converters.BoolConverters;assembly=Avalonia.Base"
Resources:
<UserControl.Resources>
<ResourceDictionary>
<acon:And x:Key="andConverter"/>
</ResourceDictionary>
</UserControl.Resources>
The binding: (I hope I got the multi-value syntax right)
<StackPanel.IsVisible>
<MultiBinding Converter="{DynamicResource andConverter}">
<MultiBinding.Bindings>
<Binding Path="Foo"/>
<Binding Path="Bar"/>
</MultiBinding.Bindings>
</MultiBinding>
</StackPanel.IsVisible>
What am I missing here?
Upvotes: 3
Views: 5554
Reputation: 3623
Converter="{x:Static BoolConverters.And}"
. see
https://github.com/AvaloniaUI/Avalonia/blob/cc714a203c3a16310bd4104a38f8a525588f65a2/src/Avalonia.Themes.Default/TextBox.xaml#L25 for usage example.
Upvotes: 7