From 2d4c21e414b558c43128e8e62e4cd490ede2a42c Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 13 Apr 2024 08:56:02 -0400 Subject: [PATCH 01/11] Upgraded NuGet packages --- Directory.Packages.props | 15 ++++++++------- src/Prism.DryIoc.Avalonia/build/Package.targets | 7 +++++++ 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 src/Prism.DryIoc.Avalonia/build/Package.targets diff --git a/Directory.Packages.props b/Directory.Packages.props index e1b0af5..3d3330d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,10 +2,11 @@ + - - - + + + @@ -34,11 +35,11 @@ - - + + - - + + diff --git a/src/Prism.DryIoc.Avalonia/build/Package.targets b/src/Prism.DryIoc.Avalonia/build/Package.targets new file mode 100644 index 0000000..f85cca1 --- /dev/null +++ b/src/Prism.DryIoc.Avalonia/build/Package.targets @@ -0,0 +1,7 @@ + + + + + + + From 1cd2fef124c3fd18b56d202e246bf56a20a52756 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 13 Apr 2024 09:06:56 -0400 Subject: [PATCH 02/11] Typos --- src/Prism.Avalonia/Common/MvvmHelpers.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Prism.Avalonia/Common/MvvmHelpers.cs b/src/Prism.Avalonia/Common/MvvmHelpers.cs index 06bdb7d..a28ec34 100644 --- a/src/Prism.Avalonia/Common/MvvmHelpers.cs +++ b/src/Prism.Avalonia/Common/MvvmHelpers.cs @@ -33,10 +33,10 @@ view.DataContext is null && ////#endif /// - /// Perform an on a view and viewmodel. + /// Perform an on a view and ViewModel. /// /// - /// The action will be performed on the view and its viewmodel if they implement . + /// The action will be performed on the view and its ViewModel if they implement . /// /// The parameter type. /// The view to perform the on. @@ -53,7 +53,7 @@ public static void ViewAndViewModelAction(object view, Action action) wher } /// - /// Get an implementer from a view or viewmodel. + /// Get an implementer from a view or ViewModel. /// /// /// If the view implements it will be returned. @@ -61,7 +61,7 @@ public static void ViewAndViewModelAction(object view, Action action) wher /// /// The implementer type to get. /// The view to get from. - /// view or viewmodel as . + /// view or ViewModel as . public static T GetImplementerFromViewOrViewModel(object view) where T : class { if (view is T viewAsT) From bdc4657c3962e4bf5f90dbc768245483249b6374 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 13 Apr 2024 09:09:20 -0400 Subject: [PATCH 03/11] DynamicallyAccessedMembers Attribute for linker hints --- .../Ioc/IContainerRegistryExtensions.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Prism.Avalonia/Ioc/IContainerRegistryExtensions.cs b/src/Prism.Avalonia/Ioc/IContainerRegistryExtensions.cs index 47746cf..0ab09e2 100644 --- a/src/Prism.Avalonia/Ioc/IContainerRegistryExtensions.cs +++ b/src/Prism.Avalonia/Ioc/IContainerRegistryExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using Prism.Mvvm; namespace Prism.Ioc @@ -14,7 +15,7 @@ public static class IContainerRegistryExtensions /// The Type of object to register as the dialog /// /// The unique name to register with the dialog. - public static void RegisterDialog(this IContainerRegistry containerRegistry, string name = null) + public static void RegisterDialog<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView>(this IContainerRegistry containerRegistry, string name = null) { containerRegistry.RegisterForNavigation(name); } @@ -26,7 +27,7 @@ public static void RegisterDialog(this IContainerRegistry containerRegist /// The ViewModel to use as the DataContext for the dialog /// /// The unique name to register with the dialog. - public static void RegisterDialog(this IContainerRegistry containerRegistry, string name = null) where TViewModel : Dialogs.IDialogAware + public static void RegisterDialog<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IContainerRegistry containerRegistry, string name = null) where TViewModel : Dialogs.IDialogAware { containerRegistry.RegisterForNavigation(name); } @@ -36,7 +37,7 @@ public static void RegisterDialog(this IContainerRegistry con /// /// The Type of the Window class that will be used to host dialogs in the IDialogService /// - public static void RegisterDialogWindow(this IContainerRegistry containerRegistry) where TWindow : Dialogs.IDialogWindow + public static void RegisterDialogWindow<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TWindow>(this IContainerRegistry containerRegistry) where TWindow : Dialogs.IDialogWindow { containerRegistry.Register(typeof(Dialogs.IDialogWindow), typeof(TWindow)); } @@ -47,7 +48,7 @@ public static void RegisterDialogWindow(this IContainerRegistry contain /// The Type of the Window class that will be used to host dialogs in the IDialogService /// /// The name of the dialog window - public static void RegisterDialogWindow(this IContainerRegistry containerRegistry, string name) where TWindow : Dialogs.IDialogWindow + public static void RegisterDialogWindow<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TWindow>(this IContainerRegistry containerRegistry, string name) where TWindow : Dialogs.IDialogWindow { containerRegistry.Register(typeof(Dialogs.IDialogWindow), typeof(TWindow), name); } @@ -69,7 +70,7 @@ public static void RegisterForNavigation(this IContainerRegistry containerRegist /// The Type of the object to register as the view /// /// The unique name to register with the object. - public static void RegisterForNavigation(this IContainerRegistry containerRegistry, string name = null) + public static void RegisterForNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(this IContainerRegistry containerRegistry, string name = null) { Type type = typeof(T); string viewName = string.IsNullOrWhiteSpace(name) ? type.Name : name; @@ -83,12 +84,12 @@ public static void RegisterForNavigation(this IContainerRegistry containerReg /// The ViewModel to use as the DataContext for the view /// /// The unique name to register with the view - public static void RegisterForNavigation(this IContainerRegistry containerRegistry, string name = null) + public static void RegisterForNavigation<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IContainerRegistry containerRegistry, string name = null) { containerRegistry.RegisterForNavigationWithViewModel(typeof(TView), name); } - private static void RegisterForNavigationWithViewModel(this IContainerRegistry containerRegistry, Type viewType, string name) + private static void RegisterForNavigationWithViewModel<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TViewModel>(this IContainerRegistry containerRegistry, Type viewType, string name) { if (string.IsNullOrWhiteSpace(name)) name = viewType.Name; From 1d2319bae51b3cd18c6b633acbaf362e02b9aa1d Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 13 Apr 2024 09:13:09 -0400 Subject: [PATCH 04/11] DynamicallyAccessedMembers --- .../Navigation/Regions/RegionAdapterMappings.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Prism.Avalonia/Navigation/Regions/RegionAdapterMappings.cs b/src/Prism.Avalonia/Navigation/Regions/RegionAdapterMappings.cs index 94344ff..fc81811 100644 --- a/src/Prism.Avalonia/Navigation/Regions/RegionAdapterMappings.cs +++ b/src/Prism.Avalonia/Navigation/Regions/RegionAdapterMappings.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using Prism.Ioc; using Prism.Properties; @@ -49,7 +50,7 @@ public void RegisterMapping(IRegionAdapter adapter) /// /// The type of the control /// The type of the IRegionAdapter to use with the TControl - public void RegisterMapping() where TAdapter : IRegionAdapter + public void RegisterMapping() where TAdapter : IRegionAdapter { RegisterMapping(typeof(TControl), ContainerLocator.Container.Resolve()); } From 245a0141b89b27747690d68da41240469dfd0dd0 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 13 Apr 2024 17:18:01 -0400 Subject: [PATCH 05/11] Upgraded NuGet DryIoc to 5.4.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3d3330d..efe8354 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + From c0313d74b26cb49ba68c0c984ec4711094d01d25 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 13 Apr 2024 17:48:18 -0400 Subject: [PATCH 06/11] Added reference to PolySharp and removed old references --- src/Prism.Avalonia/Prism.Avalonia.csproj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Prism.Avalonia/Prism.Avalonia.csproj b/src/Prism.Avalonia/Prism.Avalonia.csproj index 4c79601..89c2771 100644 --- a/src/Prism.Avalonia/Prism.Avalonia.csproj +++ b/src/Prism.Avalonia/Prism.Avalonia.csproj @@ -45,9 +45,10 @@ Prism.Avalonia helps you more easily design and build rich, flexible, and easy t - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + From 261e9cdc37dc9f1947fb936555d3330ab020440d Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 13 Apr 2024 17:54:17 -0400 Subject: [PATCH 07/11] Removed PollySharp, we're no longer using .NET Framework --- Directory.Packages.props | 1 - src/Prism.Avalonia/Prism.Avalonia.csproj | 4 ---- 2 files changed, 5 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index efe8354..0ccb6e5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,7 +2,6 @@ - diff --git a/src/Prism.Avalonia/Prism.Avalonia.csproj b/src/Prism.Avalonia/Prism.Avalonia.csproj index 89c2771..ccd31ef 100644 --- a/src/Prism.Avalonia/Prism.Avalonia.csproj +++ b/src/Prism.Avalonia/Prism.Avalonia.csproj @@ -45,10 +45,6 @@ Prism.Avalonia helps you more easily design and build rich, flexible, and easy t - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - From 985be8c4a408c87651fe78fba9a62e36f02dd248 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Thu, 18 Apr 2024 10:54:16 -0400 Subject: [PATCH 08/11] Bumped version --- build/Base.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Base.props b/build/Base.props index 5c99317..5bde441 100644 --- a/build/Base.props +++ b/build/Base.props @@ -2,7 +2,7 @@ - 9.0.271.11074-pre + 9.0.401.11000-pre https://github.com/AvaloniaCommunity/Prism.Avalonia Copyright (c) 2024 Xeno Innovations, Inc. MIT From 5d0ba070641a3298d32ff6528a8f1d2628559e0c Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Thu, 18 Apr 2024 10:54:35 -0400 Subject: [PATCH 09/11] Release notes and readme update --- ChangeLog.md | 13 +++++++++++++ README.md | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 009dff7..9da759b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,19 @@ Change log history for Prism.Avalonia +## v9.0.401-pre (20204-04-13) + +* Fixed typos +* DynamicallyAccessedMembers Attribute for linker hints +* Upgraded NuGet DryIoc to 5.4.3 + +## v9.0.271-pre (2024-04-12) + +* Upgraded Prism.Core to v9.0.271-pre +* Breaking Changes: + * `Prism.Dialog` + * `Prism.Region` -> `Prism.Navigation.Region` + ## v8.1.97.11072 (2024-01-27) * Added support for .NET 8 diff --git a/README.md b/README.md index b77834a..a079d26 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,10 @@ Just like Prism.WPF or Prism.Maui, your project must reference both the Prism.Av Choose the NuGet package version that matches your Avalonia version. -The Avalonia version of this package uses [SemVer](https://semver.org/) format: `MAJOR.MINOR.PATCH.REVISION`. The `REVISION` segment indicates -the Avalonia version support. For instance `v8.1.97.11000` of this library supports, Avalonia v11.0.0. +The Avalonia version of this package uses [SemVer](https://semver.org/) format: `MAJOR.MINOR.PATCH.REVISION`. The `REVISION` segment indicates the Avalonia version support. For instance `v8.1.97.11000` of this library supports, Avalonia v11.0.0. + +> major[.minor[.build[.revision]]] +> Assembly Version Attribute is limited to a `ushort` (65535) - [Ref](https://stackoverflow.com/a/73631971/249492). | Avalonia Version | NuGet Package | |-|-| From eaa96b1497bfe9545d5df63992a831c855d0d76c Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Fri, 19 Apr 2024 18:47:24 -0400 Subject: [PATCH 10/11] Test app cleanup --- .../RegionAdapters/ItemsControlRegionAdapter.cs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/e2e/SampleMvvmApp/RegionAdapters/ItemsControlRegionAdapter.cs b/e2e/SampleMvvmApp/RegionAdapters/ItemsControlRegionAdapter.cs index de2a0b7..a6aca59 100644 --- a/e2e/SampleMvvmApp/RegionAdapters/ItemsControlRegionAdapter.cs +++ b/e2e/SampleMvvmApp/RegionAdapters/ItemsControlRegionAdapter.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Avalonia.Controls; using Prism.Navigation.Regions; @@ -14,8 +11,6 @@ namespace SampleMvvmApp.RegionAdapters /// public class ItemsControlRegionAdapter : RegionAdapterBase { - #region Public Constructors - /// /// Initializes a new instance of . /// @@ -27,10 +22,6 @@ public ItemsControlRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory) { } - #endregion Public Constructors - - #region Protected Methods - /// /// Adapts an to an . /// @@ -83,7 +74,5 @@ protected override IRegion CreateRegion() { return new AllActiveRegion(); } - - #endregion Protected Methods } } From 875a1132e4c16d68dc3dd0e72e9f566e75122b50 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sun, 28 Apr 2024 08:29:29 -0400 Subject: [PATCH 11/11] Removed deprecated test projects --- PrismLibrary_Avalonia.slnf | 2 -- 1 file changed, 2 deletions(-) diff --git a/PrismLibrary_Avalonia.slnf b/PrismLibrary_Avalonia.slnf index 3f4b24d..a64a00b 100644 --- a/PrismLibrary_Avalonia.slnf +++ b/PrismLibrary_Avalonia.slnf @@ -6,9 +6,7 @@ "src\\Prism.Avalonia\\Prism.Avalonia.csproj", "src\\Prism.DryIoc.Avalonia\\Prism.DryIoc.Avalonia.csproj", "tests\\Avalonia\\Prism.Avalonia.Tests\\Prism.Avalonia.Tests.csproj", - "tests\\Avalonia\\Prism.Container.Avalonia.Shared\\Prism.Container.Avalonia.Shared.shproj", "tests\\Avalonia\\Prism.DryIoc.Avalonia.Tests\\Prism.DryIoc.Avalonia.Tests.csproj", - "tests\\Avalonia\\Prism.IocContainer.Avalonia.Tests.Support\\Prism.IocContainer.Avalonia.Tests.Support.csproj" ] } } \ No newline at end of file