<commit_before>using DryIoc;
using Prism.Mvvm;
using Prism.Navigation;
using System;
using Xamarin.Forms;

namespace Prism.DryIoc
{
    /// <summary>
    /// Extension methods to register a <see cref="Xamarin.Forms.Page"/> with <see cref="PageNavigationRegistry"/> using <see cref="IContainer"/>
    /// </summary>
    public static class DryIocExtensions
    {
        /// <summary>
        /// Registers a Page for navigation.
        /// </summary>
        /// <typeparam name="TView">The Type of Page to register</typeparam>
        /// <param name="name">The unique name to register with the Page</param>
        public static void RegisterTypeForNavigation<TView>(this IContainer container, string name = null) where TView : Page
        {
            var viewType = typeof(TView);

            if (string.IsNullOrWhiteSpace(name))
                name = viewType.Name;

            container.RegisterTypeForNavigation(viewType, name);
        }

        /// <summary>
        /// Registers a Page for navigation
        /// </summary>
        /// <param name="container"><see cref="IUnityContainer"/> used to register type for Navigation.</param>
        /// <param name="viewType">The type of Page to register</param>
        /// <param name="name">The unique name to register with the Page</param>
        /// <returns><see cref="IUnityContainer"/></returns>
        public static void RegisterTypeForNavigation(this IContainer container, Type viewType, string name)
        {
            PageNavigationRegistry.Register(name, viewType);
            container.Register(typeof(object), viewType, serviceKey: name);
        }

        /// <summary>
        /// Registers a Page for navigation.
        /// </summary>
        /// <typeparam name="TView">The Type of Page to register</typeparam>
        /// <typeparam name="TViewModel">The ViewModel to use as the unique name for the Page</typeparam><commit_msg>Ensure that we register Views with resolvable Constructors<commit_after>using DryIoc;
using Prism.Mvvm;
using Prism.Navigation;
using System;
using Xamarin.Forms;

namespace Prism.DryIoc
{
    /// <summary>
    /// Extension methods to register a <see cref="Xamarin.Forms.Page"/> with <see cref="PageNavigationRegistry"/> using <see cref="IContainer"/>
    /// </summary>
    public static class DryIocExtensions
    {
        /// <summary>
        /// Registers a Page for navigation.
        /// </summary>
        /// <typeparam name="TView">The Type of Page to register</typeparam>
        /// <param name="name">The unique name to register with the Page</param>
        public static void RegisterTypeForNavigation<TView>(this IContainer container, string name = null) where TView : Page
        {
            var viewType = typeof(TView);

            if (string.IsNullOrWhiteSpace(name))
                name = viewType.Name;

            container.RegisterTypeForNavigation(viewType, name);
        }

        /// <summary>
        /// Registers a Page for navigation
        /// </summary>
        /// <param name="container"><see cref="IUnityContainer"/> used to register type for Navigation.</param>
        /// <param name="viewType">The type of Page to register</param>
        /// <param name="name">The unique name to register with the Page</param>
        /// <returns><see cref="IUnityContainer"/></returns>
        public static void RegisterTypeForNavigation(this IContainer container, Type viewType, string name)
        {
            PageNavigationRegistry.Register(name, viewType);
            container.Register(typeof(object), 
                               viewType, 
                               made: Made.Of(FactoryMethod.ConstructorWithResolvableArguments), 
                               serviceKey: name);
        }

        /// <summary>
        /// Registers a Page for navigation.
        /// </summary>
        /// <typeparam name="TView">The Type of Page to register</typeparam>
        /// <typeparam name="TViewModel">The ViewModel to use as the unique name for the Page</typeparam>
{'fraction_non_alphanumeric': 0.11825828797624938, 'fraction_numerical': 0.0, 'mean_word_length': 2.3139344262295083, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4934991', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1009, 'n_words': 310}