/// <summary>
        /// Registers a model factory in the global model factory collection.
        /// </summary>
        /// <typeparam name="T">The type that the model class can instantiate.</typeparam>
        /// <param name="modelFactory">The model factory.</param>
        public static void RegisterModelFactory <T>(IModelFactory modelFactory) where T : class
        {
            Type type = typeof(T);

            if (ModelFactories.ContainsKey(type))
            {
                ModelFactories[type] = modelFactory;
            }

            ModelFactories.Add(type, modelFactory.Clone() as IModelFactory);
        }
 /// <summary>
 /// Sets the IModelFactory prototype that is cloned when a model factory instance is required by the framework.
 /// </summary>
 /// <param name="modelFactory">The model factory to set as the prototype.</param>
 public static void SetPrototype(IModelFactory modelFactory)
 {
     _prototypeModelFactory = modelFactory.Clone() as IModelFactory;
 }