From 4d19bd17d248b7f1c227a6989b7d49cb09399b20 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 3 Aug 2024 11:35:57 -0400 Subject: [PATCH 1/6] Upgraded NuGet packages to Avalonia v11.1.1 --- ChangeLog.md | 20 ++++++++++++++++++-- Directory.Packages.props | 23 +++++++++-------------- build/Base.props | 2 +- build/Nuget.props | 3 +-- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 2bdddac..41b9a8a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,7 +2,22 @@ Change log history for Prism.Avalonia -## v9.0.401-pre (20204-04-13) +## v9.0.401.11110-pre (2024-08-03) + +* Upgraded to Avalonia v11.1.1 + +## v9.0.401.11074-pre (2024-07-26) + +* Prism.Core v9.0.401-pre +* Removed dependency on Avalonia.ReactiveUI +* Updated documentation +* Synced with latest develop + +## v9.0.401.11000-pre (2024-04-28) + +* Fixed Prism.Core targeting v9.0.401-pre + +## v9.0.401.11074-pre (2024-04-13) * Fixed typos * DynamicallyAccessedMembers Attribute for linker hints @@ -11,8 +26,9 @@ Change log history for Prism.Avalonia ## v9.0.271-pre (2024-04-12) * Upgraded Prism.Core to v9.0.271-pre +* Using Prism.Container * Breaking Changes: - * `Prism.Dialog` + * `Prism.Dialog` [see PR #128](https://github.com/AvaloniaCommunity/Prism.Avalonia/pull/128) * `Prism.Region` -> `Prism.Navigation.Region` ## v8.1.97.11073 (2024-04-28) diff --git a/Directory.Packages.props b/Directory.Packages.props index e7c9188..42d8cf4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,5 +1,4 @@ - @@ -7,19 +6,17 @@ - - - - - - + + + + + - - + + - @@ -30,18 +27,16 @@ - - - + - + \ No newline at end of file diff --git a/build/Base.props b/build/Base.props index 7c6e063..098d664 100644 --- a/build/Base.props +++ b/build/Base.props @@ -2,7 +2,7 @@ - 9.0.401.11074-pre + 9.0.401.11100-pre https://github.com/AvaloniaCommunity/Prism.Avalonia Copyright (c) 2024 Xeno Innovations, Inc. MIT diff --git a/build/Nuget.props b/build/Nuget.props index be915ee..9823bcd 100644 --- a/build/Nuget.props +++ b/build/Nuget.props @@ -6,9 +6,8 @@ true true + * Upgraded to support Avalonia v11.1.1 * Upgraded to support Prism v9.0.401-pre - * Upgraded to support Avalonia v11.0.7 - * Removed dependency on Avalonia.ReactiveUI From c3184be16ff982a49de0130510c03439d5ad32fc Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 3 Aug 2024 11:43:32 -0400 Subject: [PATCH 2/6] Readme notes v9.0.401.11110-pre --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bc2653d..c4307d7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ > **Announcement!** > > * _Prism.Avalonia v9.0.401-pre just arrived!_ -> * _Prism.Avalonia v9.0.271-pre just arrived!_ +> * _Support for Avalonia v11.1.x has arrived!_ > * Follow the [Upgrading to Prism v9.0.x-pre](https://github.com/AvaloniaCommunity/Prism.Avalonia/wiki/Upgrading-to-Prism-v9.0) guide for breaking changes **For more samples outside of this repo, check out:** @@ -21,7 +21,7 @@ With Prism.Avalonia's logic and development approach being **similar** to that o ## Package Releases -Just like Prism.WPF or Prism.Maui, your project must reference both the Prism.Avalonia (_Core_) and Prism.DryIoc.Avalonia (_IoC container_) packages to work. +Just like _Prism.WPF or Prism.Maui_, your project must reference both the **Prism.Avalonia** (_Core_) and **Prism.DryIoc.Avalonia** (_IoC container_) packages to work. | Package | Stable | Preview |-|-|-| @@ -34,9 +34,10 @@ Choose the NuGet package version that matches your Avalonia version. Our [versioning schema](https://github.com/AvaloniaCommunity/Prism.Avalonia/wiki/Versioning-Schema) is based on the [SemVer](https://semver.org/) using the format `MAJOR.MINOR.PATCH.REVISION`. The `REVISION` segment indicates the Avalonia version support. For instance `v8.1.97.11073` equates to, Prism `v8.1.97`, Avalonia `v11.0.7`, _revision_ `3`. -| Prism Version | Avalonia Version | NuGet Package +| Prism | Avalonia | Prism.Avalonia NuGet Package |-|-|- -| v9.0.401-pre | **11.0.7** | v9.0.401.11000-pre ([Core](https://www.nuget.org/packages/Prism.Avalonia/9.0.401.11000-pre)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/9.0.401.11000-pre)) +| v9.0.401-pre | **11.1.1** | v9.0.401.11110-pre ([Core](https://www.nuget.org/packages/Prism.Avalonia/9.0.401.11110-pre)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/9.0.401.11110-pre)) +| v9.0.401-pre | **11.0.7** | v9.0.401.11074-pre ([Core](https://www.nuget.org/packages/Prism.Avalonia/9.0.401.11074-pre)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/9.0.401.11074-pre)) | v9.0.271-pre | **11.0.7** | v9.0.271.11000-pre ([Core](https://www.nuget.org/packages/Prism.Avalonia/9.0.271.11000-pre)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/9.0.271.11000-pre)) | v8.1.97 | **11.0.7** | v8.1.97.11073 ([Core](https://www.nuget.org/packages/Prism.Avalonia/8.1.97.11073)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/8.1.97.11073)) | v8.1.97 | **0.10.21** | v8.1.97.1021 ([Core](https://www.nuget.org/packages/Prism.Avalonia/8.1.97.1021)) ([DryIoc](https://www.nuget.org/packages/Prism.DryIoc.Avalonia/8.1.97.1021)) @@ -62,7 +63,11 @@ Issues posted without a description may be closed immediately. Use the discussio Add the Prism.Avalonia and its DryIoc packages to your project: ```powershell -# Avalonia v11 +# Latest Preview Release +Install-Package Prism.Avalonia -Version 9.0.401.11110-pre +Install-Package Prism.DryIoc.Avalonia -Version 9.0.401.11110-pre + +# Avalonia v11 (GA) Install-Package Prism.Avalonia -Version 8.1.97.11073 Install-Package Prism.DryIoc.Avalonia -Version 8.1.97.11073 From 2b413a20d54942986fa710d1a7824252a6528d4f Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 3 Aug 2024 12:01:54 -0400 Subject: [PATCH 3/6] Updated documentation for "Upgrading Prism" --- Upgrading-Prism.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Upgrading-Prism.md b/Upgrading-Prism.md index b0bacb9..4630e0b 100644 --- a/Upgrading-Prism.md +++ b/Upgrading-Prism.md @@ -19,21 +19,16 @@ This file documents the upgrade path from Prism v8.1.97 to v9.0-pre support. Soo Each of the following will be tagged and merged into the branch `Prism-9x` before being merged with `develop` and `master` branches. -**Progress:** - -* [/] 9.0.271-pre - Will be tagged and released -* [ ] 9.0.401-pre - Will be tagged and released - ### Release Comparison As we all know, not everything is straight forward between these two XAML technologies. However, it's a good reminder to document the differences and 'got-yas'. -* [Prism v7.2.0.1422 to v8.0.0.1909](https://github.com/PrismLibrary/Prism/compare/v7.2.0.1422...v8.0.0.1909) -* [Prism v7.2.0.1422 to v8.1.97](https://github.com/PrismLibrary/Prism/compare/v7.2.0.1422...v8.1.97) -* [Prism v8.0.0.1909 to v8.1.97](https://github.com/PrismLibrary/Prism/compare/v8.0.0.1909...v8.1.97) -* [DNF - 9.0.264-pre](https://github.com/PrismLibrary/Prism/compare/DNF...9.0.264-pre) - (_DNF = Dot Net Foundation_) -* [9.0.264-pre - 9.0.274-pre](https://github.com/PrismLibrary/Prism/compare/9.0.264-pre...9.0.271-pre) * [9.0.274-pre - 9.0.401-pre](https://github.com/PrismLibrary/Prism/compare/9.0.271-pre...9.0.401-pre) +* [9.0.264-pre - 9.0.274-pre](https://github.com/PrismLibrary/Prism/compare/9.0.264-pre...9.0.271-pre) +* [DNF - 9.0.264-pre](https://github.com/PrismLibrary/Prism/compare/DNF...9.0.264-pre) - (_DNF = Dot Net Foundation_) +* [Prism v8.0.0.1909 to v8.1.97](https://github.com/PrismLibrary/Prism/compare/v8.0.0.1909...v8.1.97) +* [Prism v7.2.0.1422 to v8.1.97](https://github.com/PrismLibrary/Prism/compare/v7.2.0.1422...v8.1.97) +* [Prism v7.2.0.1422 to v8.0.0.1909](https://github.com/PrismLibrary/Prism/compare/v7.2.0.1422...v8.0.0.1909) ### Changes @@ -529,7 +524,8 @@ public class ItemMetadata : AvaloniaObject ### Property -Note +Note: + * Avalonia places WPF's `propertyType` as part of `TValue` in `` * The `THost` object type is what is used in the Get and Set methods. From 6bb9c9d9d192bb2e3218a317e32e30e353ea0968 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 3 Aug 2024 13:30:35 -0400 Subject: [PATCH 4/6] Cleaned up ModulesSample providing insights with event counter --- e2e/DummyModule1/DummyModule1.cs | 32 ++++------ e2e/DummyModule2/DumyModule2.cs | 2 +- e2e/DummyModule2/Views/DummyModuleView2.axaml | 18 +++--- .../Views/DummyModuleView2.axaml.cs | 12 ++-- e2e/ModulesSample/App.axaml.cs | 7 -- e2e/ModulesSample/CallbackLogger.cs | 64 ------------------- e2e/ModulesSample/MainWindow.axaml | 28 ++++++-- e2e/ModulesSample/MainWindow.axaml.cs | 27 +++----- .../AggregateModuleCatalog.cs | 1 + .../Module System Logic/ModuleTracker.cs | 4 ++ 10 files changed, 69 insertions(+), 126 deletions(-) delete mode 100644 e2e/ModulesSample/CallbackLogger.cs diff --git a/e2e/DummyModule1/DummyModule1.cs b/e2e/DummyModule1/DummyModule1.cs index 1cc6bf9..fc3177a 100644 --- a/e2e/DummyModule1/DummyModule1.cs +++ b/e2e/DummyModule1/DummyModule1.cs @@ -1,13 +1,9 @@ -// Temp disabled logging: -// - Prism.Logging has been moved and `ILoggerFacade` is deprecated.Prism.Logging.Serilog is out of date. -// - https://github.com/augustoproiete/prism-logging-serilog/issues/3 -using System.Threading; +using System.Threading; using DummyModule.View; using ModulesSample.Infrastructure; using Prism.Avalonia.Infrastructure.Events; using Prism.Events; using Prism.Ioc; -////using Prism.Logging; using Prism.Modularity; using Prism.Navigation.Regions; @@ -15,40 +11,40 @@ namespace DummyModule { public class DummyModule1 : IModule { - ////private readonly ILoggerFacade _logger; private readonly IModuleTracker _moduleTracker; + private readonly IEventAggregator _eventAggregator; private readonly IRegionManager _regionManager; public DummyModule1(IModuleTracker moduleTracker, IEventAggregator eventAggregator, IRegionManager regionManager) - ////public DummyModule1(ILoggerFacade logger, IModuleTracker moduleTracker, IEventAggregator eventAggregator, IRegionManager regionManager) { - ////_logger = logger; _moduleTracker = moduleTracker; _eventAggregator = eventAggregator; _regionManager = regionManager; } - private void DummyEventPublisher() - { - while (true) - { - Thread.Sleep(2500); - _eventAggregator.GetEvent().Publish(); - } - } - public void RegisterTypes(IContainerRegistry containerRegistry) { } public void OnInitialized(IContainerProvider containerProvider) { - Thread thread = new Thread(new ThreadStart(DummyEventPublisher)); + // Send Event messages for subscribers to react to + Thread thread = new(new ThreadStart(DummyEventPublisher)); thread.Start(); _regionManager.RegisterViewWithRegion(RegionNames.Region1, typeof(DummyModuleView)); _moduleTracker.RecordModuleInitialized(ModuleNames.ModuleDummy1); } + + /// Publish events to subscribers. + private void DummyEventPublisher() + { + while (true) + { + Thread.Sleep(500); + _eventAggregator.GetEvent().Publish(); + } + } } } diff --git a/e2e/DummyModule2/DumyModule2.cs b/e2e/DummyModule2/DumyModule2.cs index 11080a1..87e6598 100644 --- a/e2e/DummyModule2/DumyModule2.cs +++ b/e2e/DummyModule2/DumyModule2.cs @@ -19,7 +19,7 @@ public DummyModule2(IModuleTracker moduleTracker, IRegionManager regionManager) public void OnInitialized(IContainerProvider containerProvider) { - _moduleTracker.RecordModuleInitialized(ModuleNames.ModuleDummy1); + _moduleTracker.RecordModuleInitialized(ModuleNames.ModuleDummy2); _regionManager.RegisterViewWithRegion(RegionNames.Region2, typeof(DummyModuleView2)); } diff --git a/e2e/DummyModule2/Views/DummyModuleView2.axaml b/e2e/DummyModule2/Views/DummyModuleView2.axaml index e63d4db..db802b0 100644 --- a/e2e/DummyModule2/Views/DummyModuleView2.axaml +++ b/e2e/DummyModule2/Views/DummyModuleView2.axaml @@ -1,13 +1,15 @@  - - - - + x:Class="DummyModule2.View.DummyModuleView2" + prism:ViewModelLocator.AutoWireViewModel="True"> + + diff --git a/e2e/DummyModule2/Views/DummyModuleView2.axaml.cs b/e2e/DummyModule2/Views/DummyModuleView2.axaml.cs index 61f85fb..6cb9f14 100644 --- a/e2e/DummyModule2/Views/DummyModuleView2.axaml.cs +++ b/e2e/DummyModule2/Views/DummyModuleView2.axaml.cs @@ -10,7 +10,8 @@ namespace DummyModule2.View public partial class DummyModuleView2 : UserControl { private readonly IEventAggregator _eventAggregator; - private TextBox _regionViewTextBox; + private readonly Label _regionViewTextBox; + private int _counter = 0; public DummyModuleView2() { @@ -22,16 +23,19 @@ public DummyModuleView2(IEventAggregator eventAggregator, IRegionManager regionM InitializeComponent(); - _regionViewTextBox = this.FindControl("RegionViewTextBox"); + _regionViewTextBox = this.FindControl