、私のモジュールがロードは、私はこのエラーを取得する:Prism/Unityに自動的にビュー(UserControl)を解決させる方法はありますか?複合アプリケーション(プリズム)で
{"The current build operation (build key Build Key[CustomersModul.ViewModels.CustomerAllViewModel, null]) failed: The parameter view could not be resolved when attempting to call constructor CustomersModul.ViewModels.CustomerAllViewModel(CustomersModul.Views.CustomerAllView view). (Strategy type Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy, index 2)"}
私はこのクラス解決しています:
CustomerAllViewModel layoutManager = this.container.Resolve<CustomerAllViewModel>();
を、そのクラスは、のように見えますこの:
public class CustomerAllViewModel : ViewModelBase
{
public CustomerAllView View { get; set; }
public ICommand TextChangeCommand { get; set; }
private Customer customer;
public CustomerAllViewModel(CustomerAllView view)
{
View = view;
view.DataContext = this;
...
通常、私はプレゼンターにコンストラクターパラメーターを持たず、ビューを内部的にインスタンス化します。 Viewをパラメータとして受け入れるViewModelを初めて使用しています。
私はReSharperのとのビューに行くとき、私は後ろのXAMLまたはコードに行きたい場合は興味深いことに、それは私に尋ねるので、おそらくPrismはインスタンス化するかを混乱さ?
パラメータで、このビュー(UserControlとXAMLおよびコードビハインド)が自動的にインスタンス化されるようにするにはどうすればよいですか?
これはどのようにあなたのために行くのですか? –