1
我有以下登記:我如何註冊多個服務,在溫莎城堡的特定接口
container.Register(AllTypes.FromAssemblyContaining<ITabViewModel>().BasedOn<ITabViewModel>());
兩類:
public class StructureDecorationViewModel : NotificationObject, ITabViewModel
{
...
}
public abstract class NotificationObject : INotifyPropertyChanged
{
...
}
和兩個解析器:
serviceProvider.ResolveAll<System.ComponentModel.INotifyPropertyChanged>()
serviceProvider.ResolveAll<ITabViewModel>()
這兩個Resolvers都提供了StructureDecorationViewModel,我如何過濾註冊以便我只註冊ister ITabViewModel而不是INotifyPropertyChange?
感謝您的幫助,兩種解決方案都運行良好。然而,我仍然從類型INotifyPropertyChanged的ResolveAll獲得服務。但升級到溫莎城堡的v3後,這種情況就消失了。 – 2012-01-12 11:17:02