我在Wpf MVVM Light interceptor
上使用Usercontrol
时遇到了一些问题。
当我尝试在WPF interceptor
上使用userControl
时,我无法将其用作window.Content
。
我的应用程序显示userControl
的动态类型,而不是显示xaml部分。
没有interceptor
:
http://img11.hostingpics.net/pics/984030821.jpg
interceptor
:
http://img11.hostingpics.net/pics/526552682.jpg
示例:
var container = new Container();
var view = container.Resolve<IAuthView>("auth");
var window = new Window();
window.Content = view;
window.ShowDialog();
容器:
// Working well.
this.RegisterType<IAuthView, AuthView>("auth", new InjectionConstructor(this.Resolve<IAuthViewModel>()));
// Not working.
this.AddNewExtension<Interception>();
this.RegisterType<IAuthView, AuthView>("auth", new InjectionConstructor(this.Resolve<IAuthViewModel>()), new Interceptor<InterfaceInterceptor>(), new InterceptionBehavior<LoggingInterceptionBehavior>());
nota:我认为我的interceptor
还可以,因为当我尝试使用非WPF UserControl
时,它运行良好。
nota2:方法WillExecute
和GetRequiredInterfaces
被很好地调用。
我在网上再次搜索和搜索没有结果:(
有什么想法吗?