/// <summary> /// Gets the view type for the given view model. /// </summary> /// <typeparam name="TViewModel">The type of view model to get the view for.</typeparam> public static bool TryResolveViewType <TViewModel>(this IViewLocator viewLocator, [NotNullWhen(true)] out Type?viewType) where TViewModel : class { if (viewLocator is null) { throw new ArgumentNullException(nameof(viewLocator)); } return(viewLocator.TryResolveViewType(typeof(TViewModel), out viewType)); }