This document outlines the path to upgrading your projects from Avalonia v0.10.18 to v11.xx. Please read over this document and suggest changes to help improve the documentation. After all, we learn from one another.
Check out Avalonia's Breaking Changes wiki page for more information
- https://github.com/AvaloniaUI/Avalonia/compare/release/11.0.0-preview7...release/11.0.0-preview8 (198 commits, 279 file changes)
- https://github.com/AvaloniaUI/Avalonia/compare/release/11.0.0-preview6...release/11.0.0-preview7 (437 commits, 581 file changes)
- https://github.com/AvaloniaUI/Avalonia/compare/release/11.0.0-preview5...release/11.0.0-preview6 (970 commits, 1,088 file changes)
- https://github.com/AvaloniaUI/Avalonia/compare/11.0.0-preview4...11.0.0-preview5
- https://github.com/AvaloniaUI/Avalonia/compare/11.0.0-preview3...11.0.0-preview4
- https://github.com/AvaloniaUI/Avalonia/compare/11.0.0-preview2...11.0.0-preview3
- https://github.com/AvaloniaUI/Avalonia/compare/11.0.0-preview1...11.0.0-preview2
- Converted ItemsControlRegionAdapter to use ItemsSource.
NOTE: Breaking Changes Ahead!
Breaking Changes wiki
- Interface Deprecation
- See, PR #9553
- I.E.
IAvaloniaObject
->AvalonObject
, and more.
- WindowNotificationManager Pop-Ups are no longer working in 11 Preview 5
- Themes:
- Themes must be download as part of a separate package and
App.axaml
implementation has changed. - User MUST set a theme in
App.axaml
, otherwise the window's contents may be transparent - See, PR# 8148, PR #8166, Issue #5593
- NEW:
<SimpleTheme />
- OLD:
<SimpleTheme Mode="Light" />
- Both Avalonia.Themes.Fluent and Avalonia.Themes.Simple (formally, Default) are not a part of the main Avalonia nuget package anymore. You need to add a PackageReference to include either of these packages or both.
- Its been observed that when setting a background image in your control or window, all of the controls will appear cloudy. Upgrade or defect?
- Themes must be download as part of a separate package and
- NEW: IDialogWindow now implements
WindowClosingEventArgs
.- See, Issue #9524, PR #9715
- This affects
IDialogWindow
implementation ofpublic event EventHandler<WindowClosingEventArgs>? Closing;
- Avalonia.ReactiveUI.Events.
- See, PR #5423
Previously, users had to set the HostWindow inside the main shell Window as you see below. Now, users can define this from any UserControl view by simply providing notifyService.SetHostWindow(TopLevel.GetTopLevel(this))
in the view's .axaml.cs override void OnAttachedToVisualTree(..)
method.
public partial class DashboardView : UserControl
{
public DashboardView()
{
InitializeComponent();
}
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnAttachedToVisualTree(e);
// Initialize the WindowNotificationManager with the MainWindow
var notifyService = ContainerLocator.Current.Resolve<INotificationService>();
notifyService.SetHostWindow(TopLevel.GetTopLevel(this));
}
}
- Themes in sample are showing up cloudy
- Selected ListView item still appears after clearing the List
- STATUS: Needs reported
- Reproduce:
- Add items to ListView to fill 2+ pages
- Scroll down to select item
- Clear list
- Resize window to show area previous now shown
- Result:
- Selected item still appears in list despite items removed from collection
When using Fluent theme, you no longer has a Mode
attribute.
<!-- New -->
<FluentTheme />
<!-- Old -->
<FluentTheme Mode="Light" />
DataTemplates now require a DataType
to be defined. This actually improves intellisense of your XAML and loading times with MVVM.
As a workaround for ListViews, you can use the ItemTemplate
which does not require the definition of a DataType
.