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- ...
随机推荐
- 模态框(layer)
推荐一个好看的模态框(layer) 地址:http://layer.layui.com/ 相应列子及配置 全部来自于官网,可直接访问官网学习了解. //信息框-例1 layer.alert('见 ...
- sysbench基准测试工具
一.简介SysBench是一个模块化的.跨平台.多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况.当前功能允许测试的系统参数有:file I/O performance (文件I ...
- Python学习【第7篇】:Python之常用模块2
hashlib,configparser,logging模块 一.常用模块二 hashlib模块 hashlib提供了常见的摘要算法,如md5和sha1等等. 那么什么是摘要算法呢?摘要算法又称为哈希 ...
- 『REM』手机屏幕适配
function adapt(designWidth, rem2px){ var d = window.document.createElement('div'); d.style.width = ' ...
- 【[Offer收割]编程练习赛 14 A】小Hi和小Ho的礼物
[题目链接]:http://hihocoder.com/problemset/problem/1505 [题意] [题解] 考虑Meet in the middle. 因为两个数的和不是很大; 直接用 ...
- Element 'dependencies' cannot have character[children],because the type's content type is elemen
问题描述: Element 'xxxxxxx' cannot have character [children],because the type's content type is element- ...
- CODEVS1533 Fibonacci数列 (矩阵乘法)
嗯,,,矩阵乘法最基础的题了. Program CODEVS1250; ..,..] of longint; var T,n,mo:longint; a,b:arr; operator *(a,b:a ...
- ASP.NET MVC 源码分析(二) —— 从 IRouteBuilder认识路由构建
我们来看IRouteBuilder的定义: public interface IRouteBuilder { IRouter DefaultHandler { get; set; } IService ...
- Adobe photoshop CC 2018安装激活教程
2017年10月,Adobe公司发布最新版Adobe CC 2018系列软件,photoshop cc 2018更是迎来惊艳的新功能.下面来分享安装和激活教程. 不会安装请加QQ:1833920353 ...
- 为datatable添加自增列
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...