You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class MyViewModel : Screen, ITransientDependency
{
[ReapeatClick]
public void Save()
{
}
}
The [ReapeatClick] method attribute uses an interceptor.
In a method ShowView():
private void ShowView()
{
var vm = IoC.Get<MyViewModel>();
IWindowManager windowManager = IoC.Get<IWindowManager>();
var dialogResult = await windowManager.ShowDialogAsync(vm);
}
When obtaining the class with an interceptor using the IoC container: var vm = IoC.Get();, the type of vm becomes Castle.Proxies.MyViewModelProxy. However, the View’s name is MyView, which prevents the View from being matched with the ViewModel.
I tried the following configuration but still could not locate the View:
The text was updated successfully, but these errors were encountered:
1130685535
changed the title
Cannot find view for ViewModels create by interceptor
Cannot find view for ViewModels create with interceptor
May 16, 2024
What kind of a project is this? (WPF, WPF .net core, Xamarin, etc..) Are you using Castle Core as your di container? Could you share some code?这是一个什么样的项目?(WPF、WPF .net core、Xamarin 等)您是否正在使用 Castle Core 作为您的容器?你能分享一些代码吗?
I have a MyViewModel class as follows:
The [ReapeatClick] method attribute uses an interceptor.
In a method ShowView():
When obtaining the class with an interceptor using the IoC container: var vm = IoC.Get();, the type of vm becomes Castle.Proxies.MyViewModelProxy. However, the View’s name is MyView, which prevents the View from being matched with the ViewModel.
I tried the following configuration but still could not locate the View:
The text was updated successfully, but these errors were encountered: