Avalonia
Avalonia copied to clipboard
"Value is null" error spam when binding to an element
Describe the bug
When binding to $self or to a named element (e.g #MyButton), the binding system emits a log message saying that "Value is null". In our real application, we have an ItemsControl which leads to hundreds of these messages being emitted, noticeably affecting performance.
The binding works fine though.
To Reproduce
Add this XAML to any window and compile:
<Button Content="{Binding $self.Flyout.Placement}">
<Button.Flyout>
<MenuFlyout Placement="AnchorAndGravity">
</MenuFlyout>
</Button.Flyout>
</Button>
This will appear in the log output:
[Binding]An error occurred binding 'Content' to 'Flyout.Placement' at 'Flyout': 'Value is null.' (Button #5560998)
Expected behavior
No error messages
Avalonia version
11.1.0-beta2
OS
No response
Additional context
No response