当前位置:网站首页>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();
});
}
边栏推荐
- Go 语言快速入门指南:第二篇 变量与常量
- 一文看懂推荐系统:概要01:推荐系统的基本概念
- 监控易火星版即将亮相:分布式运维帮助TOP3000大企业跨越管理鸿沟
- Monitor is easy to Mars debut: distributed operations help TOP3000 across management gap
- IDEA相关配置(特别完整)看完此篇就将所有的IDEA的相关配置都配置好了、设置鼠标滚轮修改字体大小、设置鼠标悬浮提示、设置主题、设置窗体及菜单的字体及字体大小、设置编辑区主题、通过插件更换主题
- 天翼云4.0来了!千城万池,无所不至!
- Electronic Industry Inventory Management Pain Points and WMS Warehouse Management System Solutions
- mysql四种隔离级别
- 我的递归从不爆栈
- How to mitigate the attack of corporate account hijacking?
猜你喜欢

LeetCode 2353. 设计食物评分系统(sortedcontainers)

共享平台如何提高财务的分账记账效率?

Data Governance: The Evolution of Data Integration and Application Patterns

redis summary_distributed cache

Technical life | How to draw a big picture of business

mongodb的游标
Interviewer: can you talk about optimistic locking and pessimistic locks

leetcode:622. 设计循环队列【循环队列板子】

55.【sort函数的升序降序】

DevOps之代码检查
随机推荐
redis总结_分布式缓存
How to deal with security risks posed by machine identities
编译型语言与解释型语言的区别
Taking advantage of cloud-network integration, e-Surfing Cloud has paved the way for digital transformation for government and enterprises
LeetCode 2343. 裁剪数字后查询第 K 小的数字
Dream weaving prompt information prompt box beautification
无法超越的100米_百兆以太网传输距离_网线有哪几种?
Why young people are snapping up domestic iPhone, because it is much cheaper and more populist
判断文件属主
KunlunBase 1.0 发布了!
Smart Microelectronics Releases Low-Power MM32L0130 Series MCU Products
golang源码分析(33)pollFD
LeetCode 2333. 最小差值平方和(贪心)
多聚体/壳聚糖修饰白蛋白纳米球/mPEG-HSA聚乙二醇人血清白蛋白纳米球的制备与研究
我的递归从不爆栈
CWE4.8:2022年危害最大的25种软件安全问题
Electronic Industry Inventory Management Pain Points and WMS Warehouse Management System Solutions
监控易火星版即将亮相:分布式运维帮助TOP3000大企业跨越管理鸿沟
回收站删除的文件怎么恢复,2个方法汇总助您快速解决
POE交换机全方位解读(中)