-1

我想在我的 prism 应用程序(prism 7)中的 shell 之前显示登录屏幕,所以我不知道该怎么做,因为 app.xaml.cs 类文件中没有 OnStartup() 方法,我在引导程序之前显示登录窗口负载。以前在 prism 5 中进行登录时,我在引导程序之前打开了一个登录窗口。如果凭据正确,则加载引导程序。请帮帮我。

// app.xaml.cs file
public partial class App
{
    protected override Window CreateShell()
    {
        return Container.Resolve<Shell>();
    }

    protected override void RegisterTypes(IContainerRegistry containerRegistry)
    {

    }
    protected override IModuleCatalog CreateModuleCatalog()
    {
        return new ConfigurationModuleCatalog();
        //return  new DirectoryModuleCatalog() {  ModulePath = Environment.CurrentDirectory };
    }
}
4

2 回答 2

1

没有 OnStartup() 方法

谁说的?

写吧

protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartUp(e);
}

在您的内部app.xaml.cs并添加您需要的任何功能。

于 2018-12-26T14:43:20.597 回答
0

PrismApplicationPrismApplicationBase在 Prism 7 中,有一个孩子

protected override void OnStartup(StartupEventArgs e);

因此,正如Haukinger 所说,覆盖此方法并插入您的登录代码应该可以工作。

于 2018-12-29T09:38:42.833 回答