MVVM fails - Compiled Bindings are now the default? A11P6
See original GitHub issueDescribe the bug My application employs MVVM and data bindings. Previously, under 10.18, following axaml View snippet worked fine:
<views:CodeTextBox Grid.Row="0"
Name="PlainTextBox"
Classes="mono"
IsReadOnly="True"
IsVisible="{Binding IsPlainTextViewable}">
</views:CodeTextBox>
Note the IsVisible="{Binding IsPlainTextViewable}">
.
Now, under 11P6, it fails to compile with the error:
... PreviewPane.axaml(17,13,17,13): Avalonia error AVLN:0004: Cannot parse a compiled binding without an explicit x:DataType directive to give a starting data type for bindings.
However, if I goto the root and add the line:
x:CompileBindings="False"
to the following:
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="clr-namespace:AvantGarde.Views"
mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="300"
x:CompileBindings="False"
x:Class="AvantGarde.Views.PreviewPane">
Then everything works fine.
THIS SUGGESTS THAT COMPILED BINDINGS IS NOW THE DEFAULT?
But the documentation states: “Compiled bindings are not enabled by default.”
See: https://docs.avaloniaui.net/docs/data-binding/compiledbindings
Is this the case? Has it changed? I can find no reference to it in the list of version 11 breaking changes?
Or could I be missing something here? Is there some other global “compiled bindings setting”?
Or is this a bug?
Expected behavior Compiled bindings are not default.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Fedora 37
- Version 11 Preview 6
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 6 months ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
IRCC you can disable it in csproj with
<AvaloniaUseCompiledBindingsByDefault>false</AvaloniaUseCompiledBindingsByDefault>
Cast it like in c#