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