12

I have a composite WPF application. In one of my modules I want to make a wizard and have the steps show up in a region so I can switch between the steps easier. Originally I had this wizard showing up in a tab region and the nested region worked fine. Now I want to make it into a modal dialog box, but after I open it the inner region never gets registared with the region manager; So I can't add my wizard steps.

I was under the impression that the region manager was global, and just adding cal:RegionManager.RegionName="WizardSteps" would do it, but apparently not.

If i pass the region manager to the view I might be able to use it...Does anyone know how to add a region to a ContentControl in code behind?

4

3 に答える 3

9

それは実際には非常に簡単です。

シェルで行うように、ポップアップ xaml でリージョン名を追加します。次に、popups コンストラクターで、次の呼び出しを追加します。

public Popup(IRegionManager regionManager)
{
     InitializeComponent();
     RegionManager.SetRegionManager(this,regionManager);
}

これは Prism v.1 で機能します。後のバージョンでもあまり変わらないはずです。

于 2010-03-30T07:03:43.287 に答える
0

ほとんど機能しているものを見つけました。領域のアクティブなビューを contentContol の content プロパティにバインドできればうまくいくと確信していますが、まだそれを管理していません。

IRegionManager MyRegionManager = container.Resolve<IRegionManager>();
SingleActiveRegion newRegion = new SingleActiveRegion();
MyRegionManager.Regions.Add("WizardSteps", newRegion);

//Binding
Binding myBinding = new Binding("ActiveViews");
myBinding.Source = newRegion;
view.stepControl.SetBinding(ContentControl.ContentProperty, myBinding);
于 2009-06-22T15:32:55.657 に答える