- 
                Notifications
    You must be signed in to change notification settings 
- Fork 47
Upgrading to Avalonia v11
Coming Soon!
This page will assist you with upgrading your application to the latest Avalonia v11, which is currently in preview.
This is a breaking change that affects your Views.
Developers must define the DataType property of the DataTemplate and ItemTemplate elements.
When using Compiled Bindings in your XAML, not only will your applications perform better, but it will also allow the compiler will throw an error immediately so that you do not get any surprises at runtime.
To allow all child nodes will inherit this property, so you can enable it in your root node and disable it for a specific child if needed. Below are the 3 key properties which must be set to use in this fashion.
- xmlns:vm="using:NAMESPACE.OF.VIEWMODEL"
- x:CompileBindings="True"
- x:DataType="vm:YOURVIEWMODEL"
For more information, see the official documentation of Compiled Bindings to better assist your project's needs.
Sample:
<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:system="clr-namespace:System;assembly=mscorlib"
             xmlns:vm="using:SampleMvvmApp.ViewModels"
             x:Class="SampleMvvmApp.Views.DashboardView"
             x:CompileBindings="True"
             x:DataType="vm:DashboardViewModel">