WPF, Prism v2, Region in a modal dialog, add region in code behind

前端 未结 3 1101
清酒与你
清酒与你 2020-12-09 18:53

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

3条回答
  •  猫巷女王i
    2020-12-09 19:36

    It is actually quite simple.

    In your popup xaml add a regionname as you do in the shell. Then in the popups constructor, add the following call:

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

    This works for me in Prism v.1 - shouldn't be too much different in later versions.

提交回复
热议问题