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/Directory.Packages.props b/Directory.Packages.props index e1b0af5..0ccb6e5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,9 +3,9 @@ - - - + + + @@ -22,7 +22,7 @@ - + @@ -34,11 +34,11 @@ - - + + - - + + 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 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 | |-|-| 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 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 } } 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) 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; 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()); } diff --git a/src/Prism.Avalonia/Prism.Avalonia.csproj b/src/Prism.Avalonia/Prism.Avalonia.csproj index 4c79601..ccd31ef 100644 --- a/src/Prism.Avalonia/Prism.Avalonia.csproj +++ b/src/Prism.Avalonia/Prism.Avalonia.csproj @@ -45,9 +45,6 @@ Prism.Avalonia helps you more easily design and build rich, flexible, and easy t - 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 @@ + + + + + + +