当前位置:网站首页>WPF login with Prism
WPF login with Prism
2022-08-02 21:05:00 【whirring】
思路:In the main window before,弹出登录框,If verification is successful to turn off the login box.
LoginView 样式
<prism:Dialog.WindowStyle>
<Style TargetType="Window"> <Setter Property="Width" Value="1024" /> <Setter Property="Height" Value="512" /> <Setter Property="WindowStyle" Value="None"/> <Setter Property="ResizeMode" Value="NoResize"/> <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterScreen" /> </Style>
</prism:Dialog.WindowStyle>
LoginViewModel代码
继承IDialogAware
Login successful use ofRequestClose?.Invoke(new DialogResult(ButtonResult.OK));
在APP代码中添加
In the main window rendering bounced before
protected override void OnInitialized()
{
var dialog = Container.Resolve<IDialogService>();
dialog.ShowDialog("LoginView", callback =>
{
if (callback.Result != ButtonResult.OK)
{
Environment.Exit(0);
return;
}
//To the master form value
base.OnInitialized();
});
}
2.切换用户
public static void LoginOut(IContainerProvider containerProvider)
{
Current.MainWindow.Hide();
var dialog = containerProvider.Resolve<IDialogService>();
dialog.ShowDialog("LoginView", callback =>
{
if (callback.Result != ButtonResult.OK)
{
Environment.Exit(0);
return;
}
//To the master form value
Current.MainWindow.Show();
});
}
边栏推荐
- CUDA+Pycharm-gpu版本+Anaconda安装
- 【秒杀办法】根据二叉树的先序遍历、中序遍历、后序遍历快速创建二叉树
- 透过案例看清API接口的作用——演示1688商品详情接口
- C#里如何简单的校验时间格式
- 监控易火星版即将亮相:分布式运维帮助TOP3000大企业跨越管理鸿沟
- 深入理解IO流(第一篇)
- How to mitigate the attack of corporate account hijacking?
- Remember the stuck analysis of an industrial automation control system in .NET
- 我的递归从不爆栈
- 手机银行体验性测试:如何获取用户真实感受
猜你喜欢
随机推荐
Gear 月度更新|6 月
进程与线程
洛谷P1502 窗口的星星
回收站删除的文件怎么恢复,2个方法汇总助您快速解决
玩转云端 | 天翼云对象存储ZOS高可用的关键技术揭秘
2022最新版SSM源码分析:一套教程助你深入理解底层原理,提高核心竞争力!
Go 语言快速入门指南:第二篇 变量与常量
mysql四种隔离级别
WPF使用Prism登录
基于HDF的LED驱动程序开发(1)
我的递归从不爆栈
55.【sort函数的升序降序】
golang刷leetcode 经典(3) 设计推特
下载mysql的源码包
leetcode:622. 设计循环队列【循环队列板子】
E-Surfing Cloud 4.0 Distributed Cloud Enables Digital Transformation of Thousands of Industries
通信大学生走向岗位,哪些技能最实用?
无法超越的100米_百兆以太网传输距离_网线有哪几种?
开源一夏 |【云原生】DevOps(五):集成Harbor
LeetCode 2349. 设计数字容器系统(SortedSet)









