wpf - 如何在 prism 7 中的 shell 之前显示登录屏幕?因为 app.xaml 中有 PrismApplication 而 app.xaml.cs 中没有 OnStartup() 方法
问题描述
我想在我的 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 };
}
}
解决方案
没有 OnStartup() 方法
谁说的?
写吧
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartUp(e);
}
在您的内部app.xaml.cs
并添加您需要的任何功能。
推荐阅读
- python - 序数逻辑回归:R vs python等价
- angular - Angular如何添加多个对象而不是覆盖到localStorage
- node.js - 创建离子项目时的Npm问题
- react-native - react-native-open-map 库不工作
- ruby - 在 ruby 中捕获异常
- gatling - 在 Gatling 中,如何在 .check 中迭代 json 数组以验证所有值
- go - “x509.DecryptPEMBlock”已弃用,有什么替代方案?
- oracle - 一段时间内我能得到谁的所有解释计划?
- c++ - 在数组元素中添加数字
- python - Lambda AWS Powertools 事件验证错误