From f6c2df7396946fb8c68483f2a648b46a4f4867f9 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Fri, 26 May 2023 19:54:33 -0400 Subject: [PATCH 1/5] Upgraded Avalonia NuGet to v11.0.0-preview8. Moved NuGet package notes to props file --- build/AvaloniaDependency.props | 10 +++++----- build/Base.props | 2 +- build/Nuget.props | 1 + build/SampleApp.props | 8 ++++---- src/Prism.Avalonia/Prism.Avalonia.csproj | 2 -- src/Prism.DryIoc.Avalonia/Prism.DryIoc.Avalonia.csproj | 1 - 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/build/AvaloniaDependency.props b/build/AvaloniaDependency.props index 93ddfba..0a149c7 100644 --- a/build/AvaloniaDependency.props +++ b/build/AvaloniaDependency.props @@ -3,12 +3,12 @@ xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - - - - + + + + diff --git a/build/Base.props b/build/Base.props index 314a8c9..6f22498 100644 --- a/build/Base.props +++ b/build/Base.props @@ -2,7 +2,7 @@ - 8.1.97.4-preview.11.5 + 8.1.97.4-preview.11.8 https://github.com/AvaloniaCommunity/Prism.Avalonia Copyright (c) 2023 Avalonia Community MIT diff --git a/build/Nuget.props b/build/Nuget.props index 3f65c55..befa7e4 100644 --- a/build/Nuget.props +++ b/build/Nuget.props @@ -5,6 +5,7 @@ true false + * Upgraded to support Avalonia v11.0.0-preview8 \ No newline at end of file diff --git a/build/SampleApp.props b/build/SampleApp.props index 9c79ded..a67308b 100644 --- a/build/SampleApp.props +++ b/build/SampleApp.props @@ -6,11 +6,11 @@ - + - - - + + + diff --git a/src/Prism.Avalonia/Prism.Avalonia.csproj b/src/Prism.Avalonia/Prism.Avalonia.csproj index 15ddefc..56bed34 100644 --- a/src/Prism.Avalonia/Prism.Avalonia.csproj +++ b/src/Prism.Avalonia/Prism.Avalonia.csproj @@ -17,8 +17,6 @@ Prism.Avalonia helps you more easily design and build rich, flexible, and easy t Damian Suess, Omid Mafakher, various contributors Prism.Avalonia README.md - * Upgraded to support Avalonia v11.0.0-preview5 - Prism.Avalonia.png diff --git a/src/Prism.DryIoc.Avalonia/Prism.DryIoc.Avalonia.csproj b/src/Prism.DryIoc.Avalonia/Prism.DryIoc.Avalonia.csproj index 150d867..2084a2b 100644 --- a/src/Prism.DryIoc.Avalonia/Prism.DryIoc.Avalonia.csproj +++ b/src/Prism.DryIoc.Avalonia/Prism.DryIoc.Avalonia.csproj @@ -13,7 +13,6 @@ Copyright (c) 2023 Avalonia Community Prism.DryIoc.Avalonia README.md - * Upgraded to support Avalonia v11.0.0-preview5 prism;mvvm;xaml;avalonia;dryioc;dependencyinjection;navigation;dialog;prismavalonia; Prism.Avalonia.png From e45996a51366571d86149967e74cbc7ab2c6b82a Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Fri, 26 May 2023 21:14:39 -0400 Subject: [PATCH 2/5] Avalonia v11-Preview8 ItemsControl.Items is readonly. Use `.Add(..)` instead of overwriting it --- src/Prism.Avalonia/Regions/ItemsControlRegionAdapter.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Prism.Avalonia/Regions/ItemsControlRegionAdapter.cs b/src/Prism.Avalonia/Regions/ItemsControlRegionAdapter.cs index 9a59b98..34c59bb 100644 --- a/src/Prism.Avalonia/Regions/ItemsControlRegionAdapter.cs +++ b/src/Prism.Avalonia/Regions/ItemsControlRegionAdapter.cs @@ -50,7 +50,12 @@ protected override void Adapt(IRegion region, ItemsControl regionTarget) } // Avalonia v11-Preview5 needs IRegion implement IList. Enforcing it to return AvaloniaList fixes this. - regionTarget.Items = region.Views as Avalonia.Collections.AvaloniaList; + // Avalonia v11-Preview8 ItemsControl.Items is readonly. + ////regionTarget.Items = region.Views as Avalonia.Collections.AvaloniaList; + foreach (var item in region.Views as Avalonia.Collections.AvaloniaList) + { + regionTarget.Items.Add(item); + } } /// From 0f5285834dcdf97c8f5913f6044d3d6bc13e7c0f Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Wed, 31 May 2023 15:37:28 -0400 Subject: [PATCH 3/5] Converted ItemsControlRegionAdapter to use ItemsSource. As of Avalonia PR #10827, `ItemsControl.Items` is readonly and should use `ItemsControls.ItemsSource` (PR #10590) --- samples/SampleMvvmApp/Views/DashboardView.axaml | 4 ++-- src/Prism.Avalonia/Regions/ItemsControlRegionAdapter.cs | 7 ++----- src/Prism.Avalonia/Regions/Region.cs | 1 + .../Mocks/Views/MockBindingsView.axaml | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/samples/SampleMvvmApp/Views/DashboardView.axaml b/samples/SampleMvvmApp/Views/DashboardView.axaml index 6abda6b..8bba943 100644 --- a/samples/SampleMvvmApp/Views/DashboardView.axaml +++ b/samples/SampleMvvmApp/Views/DashboardView.axaml @@ -30,7 +30,7 @@ @@ -51,7 +51,7 @@ fixes this. - // Avalonia v11-Preview8 ItemsControl.Items is readonly. + // Avalonia v11-Preview8 ItemsControl.Items is readonly (#10827). ////regionTarget.Items = region.Views as Avalonia.Collections.AvaloniaList; - foreach (var item in region.Views as Avalonia.Collections.AvaloniaList) - { - regionTarget.Items.Add(item); - } + regionTarget.ItemsSource = region.Views as Avalonia.Collections.AvaloniaList; } /// diff --git a/src/Prism.Avalonia/Regions/Region.cs b/src/Prism.Avalonia/Regions/Region.cs index 2d1ebca..2fe7f7d 100644 --- a/src/Prism.Avalonia/Regions/Region.cs +++ b/src/Prism.Avalonia/Regions/Region.cs @@ -369,6 +369,7 @@ private void InnerAdd(object view, string viewName, IRegionManager scopedRegionM { throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, Resources.RegionViewNameExistsException, viewName)); } + itemMetadata.Name = viewName; } diff --git a/tests/Avalonia/Prism.Avalonia.Tests/Mocks/Views/MockBindingsView.axaml b/tests/Avalonia/Prism.Avalonia.Tests/Mocks/Views/MockBindingsView.axaml index 9710317..e69769f 100644 --- a/tests/Avalonia/Prism.Avalonia.Tests/Mocks/Views/MockBindingsView.axaml +++ b/tests/Avalonia/Prism.Avalonia.Tests/Mocks/Views/MockBindingsView.axaml @@ -10,7 +10,7 @@ Date: Wed, 31 May 2023 15:55:30 -0400 Subject: [PATCH 4/5] Updated version information and notes to v8.1.97.11-preview.11.8 --- ChangeLog.md | 5 +++++ Upgrading-to-Avalonia-11.md | 14 +++++++++++--- build/Base.props | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 5ada59a..d963d0e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,11 @@ Change log history for Prism.Avalonia +## v8.1.97.11-preview.11.8 (2023-05-31) + +* Update: Converted ItemsControlRegionAdapter to use `ItemsSource` instead of `Items` + * As of Avalonia PR [#10827](https://github.com/AvaloniaUI/Avalonia/pull/10827), `ItemsControl.Items` is readonly and should use `ItemsControls.ItemsSource` (PR [#10590](https://github.com/AvaloniaUI/Avalonia/pull/10590)) + ## v8.1.97.4-preview.11.5 (2022-02-??) * New: Support for Avalonia v11.0 Preview 5 diff --git a/Upgrading-to-Avalonia-11.md b/Upgrading-to-Avalonia-11.md index bf2a738..afe264b 100644 --- a/Upgrading-to-Avalonia-11.md +++ b/Upgrading-to-Avalonia-11.md @@ -4,11 +4,21 @@ This document outlines the path to upgrading your projects from Avalonia v0.10.1 Check out Avalonia's [Breaking Changes](https://github.com/AvaloniaUI/Avalonia/wiki/Breaking-Changes) wiki page for more information -* https://github.com/AvaloniaUI/Avalonia/compare/release/11.0.0-preview4...release/11.0.0-preview5 +* 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 +## 11.0 Preview 8 + +### Breaking Changes + +* Converted ItemsControlRegionAdapter to use ItemsSource. + * As of Avalonia PR [#10827](https://github.com/AvaloniaUI/Avalonia/pull/10827), `ItemsControl.Items` is readonly and should use `ItemsControls.ItemsSource` (PR [#10590](https://github.com/AvaloniaUI/Avalonia/pull/10590)) + ## 11.0 Preview 5 **NOTE:** Breaking Changes Ahead! @@ -91,7 +101,6 @@ When using Fluent theme, you no longer has a `Mode` attribute. ``` - ## 11.0 Preview 4 ### DataTemplates @@ -99,4 +108,3 @@ When using Fluent theme, you no longer has a `Mode` attribute. 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`. - diff --git a/build/Base.props b/build/Base.props index 6f22498..00fdee2 100644 --- a/build/Base.props +++ b/build/Base.props @@ -2,7 +2,7 @@ - 8.1.97.4-preview.11.8 + 8.1.97.11-preview.11.8 https://github.com/AvaloniaCommunity/Prism.Avalonia Copyright (c) 2023 Avalonia Community MIT From 2d02f5e5212329da80ec46db534d1641ef6c18f2 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Wed, 31 May 2023 16:18:00 -0400 Subject: [PATCH 5/5] Updated version notes --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index aadec33..fed5e95 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ Choose the NuGet package version that matches your Avalonia version. |-|-| | 0.10.x | 8.1.97.2 | 11.0 Preview 4 | 8.1.97.3-preview.11.4 -| 11.0 Preview 5 | 8.1.97.4-preview.11.5) -| 11.0 Preview 6 | 8.1.97.5-preview.11.6 (_COMING SOON_) +| 11.0 Preview 5 | 8.1.97.4-preview.11.5 +| 11.0 Preview 8 | 8.1.97.11-preview.11.8 Be sure to check out the [ChangeLog.md](ChangeLog.md) and [Upgrading-to-Avalonia-11.md](Upgrading-to-Avalonia-11.md) when upgrading your NuGet packages @@ -31,9 +31,9 @@ Add the Prism.Avalonia and its DryIoc packages to your project: Install-Package Prism.Avalonia -Version 8.1.97.2 Install-Package Prism.DryIoc.Avalonia -Version 8.1.97.2 -# Avalonia v11-preview5 -Install-Package Prism.Avalonia -Version 8.1.97.4-preview.11.5 -Install-Package Prism.DryIoc.Avalonia -Version 8.1.97.4-preview.11.5 +# Avalonia v11-preview8 +Install-Package Prism.Avalonia -Version 8.1.97.11-preview.11.8 +Install-Package Prism.DryIoc.Avalonia -Version 8.1.97.11-preview.11.8 ``` ## How to use