Prism.Interactivity 之 PopupWindowAction 用法简记
- PopupWindow通过InteractionRequestTrigger(EventTrigger的派生类)侦听目标对象(InteractionRequest<T>类型)的Raised事件Show出来;
<winInteractivity:Interaction.Triggers>
<prism:InteractionRequestTrigger SourceObject="{Binding Path=EmployeePopupViewRequest,Mode=OneWay}">
<prism:PopupWindowAction IsModal="True" CenterOverAssociatedObject="True">
<prism:PopupWindowAction.WindowContent>
<views:EmployeeView />
</prism:PopupWindowAction.WindowContent>
</prism:PopupWindowAction>
</prism:InteractionRequestTrigger>
</winInteractivity:Interaction.Triggers>
- PopupWindow实现IInteractionRequestAware接口,通过Action委托成员FinishInteraction关闭PopupWindow;
public Action FinishInteraction { get; set; }
public INotification Notification
{
get
{
return this.DataContext as INotification;
}
set
{
this.DataContext = value;
}
}
private void CloseWindow()
{
if (this.FinishInteraction != null)
this.FinishInteraction();
}
- InteractionRequestedEventArgs(上述Raised事件的事件处理器的EventArgs)有两个主要成员,一个是INotification的派生类(将会作为PopupWindow的DataContext:即ViewModel),另一个是回调使用的Action委托。
Prism.Interactivity 之 PopupWindowAction 用法简记的更多相关文章
- Prism.Interactivity 和 Prism.Modularity 介绍
Prism.Interactivity: 主要用来截取View即界面的一些处理,而这些功能通过vm 不好实现,只能用 CommandBehaviorBase 来截取处理,特别是在处理界面异常很有用. ...
- 从PRISM开始学WPF(九)交互(完结)
0x07交互 Notification xaml: <Window x:Class="UsingPopupWindowAction.Views.MainWindow" xml ...
- 从PRISM开始学WPF(九)交互Interaction?
0x07交互 这是这个系列的最后一篇了,主要介绍了Prism中为我们提供几种弹窗交互的方式. Notification通知式 Prism通过InteractionRequest 来实现弹窗交互,它是一 ...
- WPF Prism MVVM 中 弹出新窗体. 放入用户控件
原文:WPF Prism MVVM 中 弹出新窗体. 放入用户控件 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/qq_37214567/artic ...
- Prism5.0新内容 What's New in Prism Library 5.0 for WPF(英汉对照版)
Prism 5.0 includes guidance in several new areas, resulting in new code in the Prism Library for WPF ...
- .NET Core 3 WPF MVVM框架 Prism系列之命令
本文将介绍如何在.NET Core3环境下使用MVVM框架Prism的命令的用法 一.创建DelegateCommand命令 我们在上一篇.NET Core 3 WPF MVVM框架 Prism系列之 ...
- [Prism框架实用分享]如何在主程序中合理的弹出子窗体
大家好 说起子窗体,大家都会想到ChildWindow,多熟悉的一个控件.不错,Sliverlight中已经提供了子窗体的具体实现,而在WPF中却没有这么好的事情(有的第三方控件商已经提供此控件).最 ...
- 《Prism 5.0源码走读》Prism 5.0简介
Prism是一个开发和设计模块化WPF应用的基础框架,里面包含了MVVM pattern和设计示例.当前最新的版本是Prism 5.0,官方网站:https://compositewpf.codepl ...
- 1: 介绍Prism5.0 Introduction to the Prism Library 5.0 for WPF(英汉对照版)
Prism provides guidance designed to help you more easily design and build rich, flexible, and easy- ...
随机推荐
- 【Apache Kafka】一、Kafka简介及其基本原理
对于大数据,我们要考虑的问题有很多,首先海量数据如何收集(如Flume),然后对于收集到的数据如何存储(典型的分布式文件系统HDFS.分布式数据库HBase.NoSQL数据库Redis),其次存储 ...
- swift--如何设置子视图alpha不同于父视图
//1.2加入商家标题评分容器 let titleWarp=UIView(frame: CGRectMake(, , screenObject.width, )); titleWarp.backgro ...
- Centos 7 关闭firewall防火墙启用iptables防火墙
一.关闭firewall防火墙 1.停止firewall systemctl stop firewalld.service 2.禁止firewall开机启动 systemctl disable fir ...
- Git 基础教程 之 搭建Git服务器
截图自: 廖雪峰老师官方网站 https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0 ...
- Git 基础教程 之 多人协作
多人协作时,从远程克隆时,默认情况下,只能看到master分支 git checkout -b dev origin/dev 创建远程origin的dev分支到本地 git branch ...
- PAT 1105 Spiral Matrix
This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasi ...
- 303. Range Sum Query - Immutable(动态规划)
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive ...
- 【[Offer收割]编程练习赛 14 A】小Hi和小Ho的礼物
[题目链接]:http://hihocoder.com/problemset/problem/1505 [题意] [题解] 考虑Meet in the middle. 因为两个数的和不是很大; 直接用 ...
- HDU 5442 Favorite Donut
Favorite Donut Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) ...
- SCU Travel
Travel The country frog lives in has n towns which are conveniently numbered by 1,2,…,n . Among n(n− ...