protected override Type ResolveComponent()
            {
                Type result = null;

                if (ContextObject is TContext)
                {
                    result = ObjectTypeResolver.ResolveComponentTypeForObject <TContext, TModel>(ContextObject, Model ?? default, AssignableFrom);
                }
                if (result is null && TypeTypeResolver != ObjectTypeResolver)
                {
                    result = TypeTypeResolver.ResolveComponentTypeForContext <TContext, TModel>(Model ?? default, AssignableFrom);
                }
                if (result is null && TypeResolver != ObjectTypeResolver && TypeResolver != TypeTypeResolver)
                {
                    result = base.ResolveComponent(); //already uses the model if provided
                }
                return(result);
            }
        protected Type ResolveComponent()
        {
            Type result = null;

            //Don't try to resolve the template multiple times if the injected resolvers are the same object that just implements the different interfaces, like the DefaultComponentTypeResolver
            if (ContextObject is object)
            {
                result = ObjectTypeResolver.ResolveComponentTypeForObject(ContextObject, Model ?? default, AssignableFrom);
            }
            if (result is null && TypeTypeResolver != ObjectTypeResolver)
            {
                result = TypeTypeResolver.ResolveComponentTypeFor(Model ?? default);
            }
            if (result is null && TypeResolver != ObjectTypeResolver && TypeResolver != TypeTypeResolver)
            {
                result = TypeResolver.ResolveComponentTypeFor(Model ?? default);
            }
            return(result);
        }