How to implement the new PrismApplication to replace the Bootstrapper class

前端 未结 3 1136
春和景丽
春和景丽 2021-01-01 13:25

Since the Bootstrapper Class is obsolete with Prism 7 I would like to change my C# WPF App using the PrismApplication Class.

Does anybody k

3条回答
  •  暖寄归人
    2021-01-01 13:42

    It depends on what your bootstrapper does, but Prism.Unity.PrismApplication has similar methods to override, so you should be able to copy the code over from the bootstrapper. Probably you only need RegisterTypes and CreateShell. Remember to update App.xaml to change the type of your application...

    App.xaml should be something like this:

    
    

    and for completeness' sake, App.xaml.cs:

    internal partial class App
    {
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            throw new NotImplementedException();
        }
    
        protected override Window CreateShell()
        {
            throw new NotImplementedException();
        }
    }
    

提交回复
热议问题