私は同じ問題を抱えていました(Unity/Prism 4)。これを解決するには、childwindowの領域からアクティブなビューを削除し、子ウィンドウ(OkButtonとCancelボタン)を閉じる前にregionManagerの領域を削除します。 それは良い解決策であるかどうかはわかりませんが、うまくいきます。 (私の領域は、子ウィンドウコンストラクタ上の領域マネージャに追加されます)
子ウィンドウコンストラクタ
this.regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
RegionManager.SetRegionManager(this.ActionContent, this.regionManager);
RegionManager.SetRegionName(this.ActionContent, REGION_NAME);
this.regionManager.Regions[REGION_NAME].Add(this.sharedViewProperty.UIElement,
this.sharedViewProperty.ViewName);
this.regionManager.Regions[REGION_NAME].Activate(this.sharedViewProperty.UIElement);
OKButton_Click
this.regionManager.Regions[REGION_NAME].Deactivate(this.sharedViewProperty.UIElement);
this.regionManager.Regions.Remove(REGION_NAME);
私はRegionManagerを設定したときに今、私は奇妙な行動を持っています私のコンストラクタ。 例外 "Microsoft.Practices.Prism.Regions.Behaviors.RegionCreationExceptionがあります:名前が 'ChildRegion'の領域を作成中に例外が発生しました。例外:System.ArgumentException:指定された名前のRegionが既に登録されている:"
域マネージャを設定する前に、私はこの次の行を挿入すると、それが動作:
this.regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
int nbCountRegion = this.regionManager.Regions.Count();
RegionManager.SetRegionManager(this.ActionContent, this.regionManager);
RegionManager.SetRegionName(this.ActionContent, REGION_NAME);
理由を教えてはいけない、私はそれを説明することはできません...