Skip to content

Commit

Permalink
Merge pull request #148 from AvaloniaCommunity/feature/Prism9x-v9.0.401
Browse files Browse the repository at this point in the history
v9.0.401-pre
  • Loading branch information
DamianSuess authored Apr 28, 2024
2 parents 54cad66 + e744fa4 commit 501dd85
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 40 deletions.
13 changes: 13 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<!-- Prism -->
<ItemGroup>
<PackageVersion Include="Prism.Core" Version="9.0.271-pre" />
<PackageVersion Include="Prism.Container.Abstractions" Version="9.0.61-pre" />
<PackageVersion Include="Prism.Container.DryIoc" Version="9.0.61-pre" />
<PackageVersion Include="Prism.Container.Unity" Version="9.0.61-pre" />
<PackageVersion Include="Prism.Container.Abstractions" Version="9.0.84-pre" />
<PackageVersion Include="Prism.Container.DryIoc" Version="9.0.84-pre" />
<PackageVersion Include="Prism.Container.Unity" Version="9.0.84-pre" />
</ItemGroup>

<!-- Avalonia -->
Expand All @@ -22,7 +22,7 @@

<!-- 3rd-Party -->
<ItemGroup>
<PackageVersion Include="DryIoc.dll" Version="5.4.1" />
<PackageVersion Include="DryIoc.dll" Version="5.4.3" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageVersion Include="System.Reactive" Version="6.0.0" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
Expand All @@ -34,11 +34,11 @@
<!-- Tests -->
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageVersion Include="Moq" Version="4.20.69" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Moq" Version="4.20.70" />
<PackageVersion Include="System.CodeDom" Version="6.0.0" />
<PackageVersion Include="xunit" Version="2.5.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.1"/>
<PackageVersion Include="xunit" Version="2.6.6" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6"/>
<PackageVersion Include="Xunit.StaFact" Version="1.1.11" />
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions PrismLibrary_Avalonia.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|-|-|
Expand Down
2 changes: 1 addition & 1 deletion build/Base.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Version>9.0.271.11074-pre</Version>
<Version>9.0.401.11000-pre</Version>
<PackageProjectUrl>https://github.com/AvaloniaCommunity/Prism.Avalonia</PackageProjectUrl>
<Copyright>Copyright (c) 2024 Xeno Innovations, Inc.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
11 changes: 0 additions & 11 deletions e2e/SampleMvvmApp/RegionAdapters/ItemsControlRegionAdapter.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -14,8 +11,6 @@ namespace SampleMvvmApp.RegionAdapters
/// </summary>
public class ItemsControlRegionAdapter : RegionAdapterBase<ItemsControl>
{
#region Public Constructors

/// <summary>
/// Initializes a new instance of <see cref="ItemsControlRegionAdapter"/>.
/// </summary>
Expand All @@ -27,10 +22,6 @@ public ItemsControlRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)
{
}

#endregion Public Constructors

#region Protected Methods

/// <summary>
/// Adapts an <see cref="ItemsControl"/> to an <see cref="IRegion"/>.
/// </summary>
Expand Down Expand Up @@ -83,7 +74,5 @@ protected override IRegion CreateRegion()
{
return new AllActiveRegion();
}

#endregion Protected Methods
}
}
8 changes: 4 additions & 4 deletions src/Prism.Avalonia/Common/MvvmHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ view.DataContext is null &&
////#endif

/// <summary>
/// Perform an <see cref="Action{T}"/> on a view and viewmodel.
/// Perform an <see cref="Action{T}"/> on a view and ViewModel.
/// </summary>
/// <remarks>
/// The action will be performed on the view and its viewmodel if they implement <typeparamref name="T"/>.
/// The action will be performed on the view and its ViewModel if they implement <typeparamref name="T"/>.
/// </remarks>
/// <typeparam name="T">The <see cref="Action{T}"/> parameter type.</typeparam>
/// <param name="view">The view to perform the <see cref="Action{T}"/> on.</param>
Expand All @@ -53,15 +53,15 @@ public static void ViewAndViewModelAction<T>(object view, Action<T> action) wher
}

/// <summary>
/// Get an implementer from a view or viewmodel.
/// Get an implementer from a view or ViewModel.
/// </summary>
/// <remarks>
/// If the view implements <typeparamref name="T"/> it will be returned.
/// Otherwise if the view's <see cref="FrameworkElement.DataContext"/> implements <typeparamref name="T"/> it will be returned instead.
/// </remarks>
/// <typeparam name="T">The implementer type to get.</typeparam>
/// <param name="view">The view to get <typeparamref name="T"/> from.</param>
/// <returns>view or viewmodel as <typeparamref name="T"/>.</returns>
/// <returns>view or ViewModel as <typeparamref name="T"/>.</returns>
public static T GetImplementerFromViewOrViewModel<T>(object view) where T : class
{
if (view is T viewAsT)
Expand Down
15 changes: 8 additions & 7 deletions src/Prism.Avalonia/Ioc/IContainerRegistryExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Prism.Mvvm;

namespace Prism.Ioc
Expand All @@ -14,7 +15,7 @@ public static class IContainerRegistryExtensions
/// <typeparam name="TView">The Type of object to register as the dialog</typeparam>
/// <param name="containerRegistry"></param>
/// <param name="name">The unique name to register with the dialog.</param>
public static void RegisterDialog<TView>(this IContainerRegistry containerRegistry, string name = null)
public static void RegisterDialog<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TView>(this IContainerRegistry containerRegistry, string name = null)
{
containerRegistry.RegisterForNavigation<TView>(name);
}
Expand All @@ -26,7 +27,7 @@ public static void RegisterDialog<TView>(this IContainerRegistry containerRegist
/// <typeparam name="TViewModel">The ViewModel to use as the DataContext for the dialog</typeparam>
/// <param name="containerRegistry"></param>
/// <param name="name">The unique name to register with the dialog.</param>
public static void RegisterDialog<TView, TViewModel>(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<TView, TViewModel>(name);
}
Expand All @@ -36,7 +37,7 @@ public static void RegisterDialog<TView, TViewModel>(this IContainerRegistry con
/// </summary>
/// <typeparam name="TWindow">The Type of the Window class that will be used to host dialogs in the IDialogService</typeparam>
/// <param name="containerRegistry"></param>
public static void RegisterDialogWindow<TWindow>(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));
}
Expand All @@ -47,7 +48,7 @@ public static void RegisterDialogWindow<TWindow>(this IContainerRegistry contain
/// <typeparam name="TWindow">The Type of the Window class that will be used to host dialogs in the IDialogService</typeparam>
/// <param name="containerRegistry"></param>
/// <param name="name">The name of the dialog window</param>
public static void RegisterDialogWindow<TWindow>(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);
}
Expand All @@ -69,7 +70,7 @@ public static void RegisterForNavigation(this IContainerRegistry containerRegist
/// <typeparam name="T">The Type of the object to register as the view</typeparam>
/// <param name="containerRegistry"></param>
/// <param name="name">The unique name to register with the object.</param>
public static void RegisterForNavigation<T>(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;
Expand All @@ -83,12 +84,12 @@ public static void RegisterForNavigation<T>(this IContainerRegistry containerReg
/// <typeparam name="TViewModel">The ViewModel to use as the DataContext for the view</typeparam>
/// <param name="containerRegistry"></param>
/// <param name="name">The unique name to register with the view</param>
public static void RegisterForNavigation<TView, TViewModel>(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<TViewModel>(typeof(TView), name);
}

private static void RegisterForNavigationWithViewModel<TViewModel>(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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -49,7 +50,7 @@ public void RegisterMapping<TControl>(IRegionAdapter adapter)
/// </summary>
/// <typeparam name="TControl">The type of the control</typeparam>
/// <typeparam name="TAdapter">The type of the IRegionAdapter to use with the TControl</typeparam>
public void RegisterMapping<TControl, TAdapter>() where TAdapter : IRegionAdapter
public void RegisterMapping<TControl, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] TAdapter>() where TAdapter : IRegionAdapter
{
RegisterMapping(typeof(TControl), ContainerLocator.Container.Resolve<TAdapter>());
}
Expand Down
3 changes: 0 additions & 3 deletions src/Prism.Avalonia/Prism.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ Prism.Avalonia helps you more easily design and build rich, flexible, and easy t

<ItemGroup>
<PackageReference Include="System.Configuration.ConfigurationManager" />
<!--<PackageReference Include="Avalonia" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" />
<PackageReference Include="Avalonia.ReactiveUI" />-->
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions src/Prism.DryIoc.Avalonia/build/Package.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project>
<ItemGroup Condition=" '$(ImplicitUsings)' == 'true' OR '$(ImplicitUsings)' == 'enable' ">
<Using Include="DryIoc" />
<Using Include="Prism.DryIoc" />
</ItemGroup>
</Project>

0 comments on commit 501dd85

Please sign in to comment.