internal static void Initialize(IEnumerable <ICreatesCommandBinding> factories)
        {
            if (factories == null)
            {
                throw new ArgumentNullException(nameof(factories));
            }

            _bindCommandCache =
                new MemoizingMRUCache <Type, ICreatesCommandBinding>(
                    (t, _) =>
            {
                return(factories
                       .Aggregate((score: 0, binding: (ICreatesCommandBinding)null), (acc, x) =>
                {
                    int score = x.GetAffinityForObject(t, false);
                    return (score > acc.score) ? (score, x) : acc;
                }).binding);
            }, RxApp.SmallCacheLimit);

            _bindCommandEventCache =
                new MemoizingMRUCache <Type, ICreatesCommandBinding>(
                    (t, _) =>
            {
                return(factories
                       .Aggregate((score: 0, binding: (ICreatesCommandBinding)null), (acc, x) =>
                {
                    int score = x.GetAffinityForObject(t, true);
                    return (score > acc.score) ? (score, x) : acc;
                }).binding);
            }, RxApp.SmallCacheLimit);
        }
        internal static void Initialize(ILogger logger, IEnumerable <ILoadedForViewFetcher> loadedForViewFetchers)
        {
            _logger = logger;

            _loadedFetcherCache =
                new MemoizingMRUCache <Type, ILoadedForViewFetcher>(
                    (t, _) =>
                    loadedForViewFetchers
                    .Aggregate((count: 0, viewFetcher: default(ILoadedForViewFetcher)), (acc, x) =>
            {
                int score = x.GetAffinityForView(t);
                return(score > acc.count ? (score, x) : acc);
            }).viewFetcher, RxApp.SmallCacheLimit);
        }