メソッドの使用中に問題が発生しました
this.regionManager.RegisterViewWithRegion("TextRegion", typeof(TextView));
上記のコードを何らかの方法でブートストラッパーに記述した場合。コードからregionmanagerのオブジェクトを取得できないため、機能しません
IRegionManager manager = this.Container.Resolve<IRegionManager>();
上記のコードは例外をスローします「例外メッセージは次のとおりです:現在のビルド操作(ビルドキーBuild Key [Microsoft.Practices.Composite.Regions.IRegionManager、null])が失敗しました:現在のタイプMicrosoft.Practices.Composite.Regions.IRegionManagerはインターフェイスであり、構築できません。タイプマッピングがありませんか?」
しかし、上記のコードは機能します。それをいくつかのViewModelに入れ、その中にIRegionManagerを挿入します。
お気に入り
public HeaderControlViewModel(IEventAggregator aggregator, IRegionManager regionManager)
: base(aggregator)
{
this.regionManager = regionManager;
this.regionManager.RegisterViewWithRegion("TextRegion", typeof(TextView));
}
しかし、私はこれをしたくありません。すべてをブートストラッパーのみで構成したい。
bootstrapperがRegionManagerオブジェクトを取得できない理由を教えてください。どうすればこの問題を解決できますか?
よろしくお願いします...