Closed
Description
Describe the bug
A binding without a property path applied to IsVisible
will not be evaluated. The control will remain visible when it should be hidden.
Adding a path of $self.DataContext
works around the issue.
To Reproduce
Start Sandbox with this window XAML:
<Window xmlns="https://github.com/avaloniaui"
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
x:Class="Sandbox.MainWindow" x:CompileBindings="False">
<StackPanel>
<Border IsVisible="{Binding, Converter={x:Static ObjectConverters.IsNotNull}}" Height="19" Background="Red" />
<Border IsVisible="{Binding $self.DataContext, Converter={x:Static ObjectConverters.IsNotNull}}" Height="19" Background="Green" />
</StackPanel>
</Window>
You will see this:
Expected behavior
The Border
with the red background should not be visible.
Avalonia version
11.2.1
OS
Windows
Additional context
Not reproducible in 11.1.x