1.prism 7.1 不再使用App.xaml来为程序设置入口。在 PRISM的项目中,需要删除App.xaml中的StartupUri

因为你不再需要使用他了,并且继承PrismApplication类,并且添加Shell主界面,最终代码如下:

App.xaml

<prism:PrismApplication x:Class="OADemo.App"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:prism="http://prismlibrary.com/"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Application.Resources>

    </Application.Resources>
</prism:PrismApplication>

App.xaml.cs

using System.Windows;
using OADemo.Views;
using Prism.Ioc;

namespace OADemo
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App
    {
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {

        }
        protected override Window CreateShell()
        {
            return Container.Resolve<Shell>();
        }
    }
}
12-26 23:01