Skip to content

Commit

Permalink
Merge pull request #3146 from jpislas/patch-1
Browse files Browse the repository at this point in the history
Update RegionNavigationRegistrationExtensions.cs
  • Loading branch information
dansiegel authored May 24, 2024
2 parents e895628 + cce2033 commit fd8b659
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public static class RegionNavigationRegistrationExtensions
where TViewModel : class =>
containerRegistry.RegisterForNavigationWithViewModel(typeof(TView), typeof(TViewModel), name);

public static IContainerRegistry RegisterForNavigationWithViewModel(this IContainerRegistry containerRegistry, Type viewType, Type viewModelType, string name)
public static IContainerRegistry RegisterForRegionNavigation(this IContainerRegistry containerRegistry, Type viewType, Type viewModelType, string name = null)
=> containerRegistry.RegisterForNavigationWithViewModel(viewType, viewModelType, name);

private static IContainerRegistry RegisterForNavigationWithViewModel(this IContainerRegistry containerRegistry, Type viewType, Type viewModelType, string name)
{
if (string.IsNullOrWhiteSpace(name))
name = viewType.Name;
Expand Down Expand Up @@ -77,6 +80,9 @@ public static IContainerRegistry RegisterForNavigationWithViewModel(this IContai
where TViewModel : class =>
services.RegisterForNavigationWithViewModel(typeof(TView), typeof(TViewModel), name);

public static IServiceCollection RegisterForRegionNavigation(this IServiceCollection services, Type viewType, Type viewModelType, string name = null)
=> services.RegisterForNavigationWithViewModel(viewType, viewModelType, name);

private static IServiceCollection RegisterForNavigationWithViewModel(this IServiceCollection services, Type viewType, Type viewModelType, string name)
{
if (string.IsNullOrWhiteSpace(name))
Expand Down

0 comments on commit fd8b659

Please sign in to comment.