Created
February 17, 2011 07:53
-
-
Save thecodejunkie/831257 to your computer and use it in GitHub Desktop.
Workaround for Unitys limitation on IEnumerable<T> dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// This class provides a workaround for Unitys lack of support for <see cref="IEnumerable{T}"/> dependencies. No additional | |
/// functionality should be added to this type. | |
/// </summary> | |
public sealed class UnityViewFactory : DefaultViewFactory | |
{ | |
/// <summary> | |
/// The <see cref="Type"/> of the <see cref="UnityViewFactory"/> type. | |
/// </summary> | |
public static Type UnityViewFactoryType = typeof(UnityViewFactory); | |
/// <summary> | |
/// Initializes a new instance of the <see cref="UnityViewFactory"/> class. | |
/// </summary> | |
/// <param name="container">A <see cref="IUnityContainer"/> instance where dependencies can be resolved from.</param> | |
public UnityViewFactory(IUnityContainer container) | |
: base(container.Resolve<IViewLocator>(), container.ResolveAll<IViewEngineEx>()) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment