/Source/Bifrost.Mimir/ViewModelConvention.cs
C# | 27 lines | 23 code | 4 blank | 0 comment | 0 complexity | df91951bb3d1f6379ef31def679b0973 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using System;
- using Bifrost.Execution;
- using Bifrost.Notification;
-
- namespace Bifrost.Mimir
- {
- public class ViewModelConvention : BaseConvention
- {
- private readonly NotifyingObjectWeaver _weaver;
-
- public ViewModelConvention()
- {
- _weaver = new NotifyingObjectWeaver();
- }
-
- public override bool CanResolve(Type service)
- {
- return service.Name.Equals("ViewModel");
- }
-
- public override void Resolve(IContainer container, Type service)
- {
- var proxy = _weaver.GetProxyType(service);
- container.Bind(service,proxy);
- }
- }
- }