导航到一个视图,如果在离开这个视图时需要确认,在VM中实现以下接口

public class ViewAViewModel : BindableBase, IConfirmNavigationRequest
{
public ViewAViewModel()
{ } public void ConfirmNavigationRequest(NavigationContext navigationContext, Action<bool> continuationCallback)
{
bool result = true; if (MessageBox.Show("Do you to navigate?", "Navigate?", MessageBoxButton.YesNo) == MessageBoxResult.No)
result = false; continuationCallback(result);
} public bool IsNavigationTarget(NavigationContext navigationContext)
{
return true;
} public void OnNavigatedFrom(NavigationContext navigationContext)
{ } public void OnNavigatedTo(NavigationContext navigationContext)
{ }
}

Prism Sample 22-ConfirmCancelNavigation的更多相关文章

  1. Android 主题动态切换框架:Prism

    Prism(棱镜) 是一个全新的 Android 动态主题切换框架,虽然是头一次发布,但它所具备的基础功能已经足够强大了!本文介绍了 Prism 的各种用法,希望对你会有所帮助,你也可以对它进行扩展, ...

  2. [转]Blue Prism Architecture

    本文转自:https://mindmajix.com/blue-prism-architecture Introduction Automation technology is widely bloo ...

  3. [转]收集android上开源的酷炫的交互动画和视觉效果:Interactive-animation

    原文链接:http://www.open-open.com/lib/view/open1411443332703.html 描述:收集android上开源的酷炫的交互动画和视觉效果. 1.交互篇 2. ...

  4. AC Milan VS Juventus(模拟)

    AC Milan VS Juventus Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Oth ...

  5. Codeforces Round #483 (Div. 2)题解

    A. Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input outpu ...

  6. Codeforces Round #483 (Div. 2) [Thanks, Botan Investments and Victor Shaburov!]

    题目链接:http://codeforces.com/contest/984 A. Game time limit per test:2 seconds memory limit per test:5 ...

  7. [转]收集android上开源的酷炫的交互动画和视觉效果

    原文链接:http://www.open-open.com/lib/view/open1411443332703.html 描述:收集android上开源的酷炫的交互动画和视觉效果. 1.交互篇 2. ...

  8. Deep Dive into Neo4j 3.5 Full Text Search

    In this blog we will go over the Full Text Search capabilities available in the latest major release ...

  9. FastDFS安装和简介详细总结

    1.fastDFS简介 1 FastDFS是用c语言编写的一款开源的分布式文件系统. 2 FastDFS为互联网量身定制,充分考虑了冗余备份.负载均衡.线性扩容等机制,并注重高可用.高性能等指标, 3 ...

  10. PRISM 4 - RegisterViewWithRegion & Custom Export Attributes

    5down votefavorite   I am using Prism 4 with MEF Extensions and the MVVM pattern. During initializat ...

随机推荐

  1. filebeat+elasticsearch+kibana

    一.到elasticsearch官网下载 filebeat+elasticsearch+kibana http://www.elasticsearch.cn/ 二.安装filebeat tar -xz ...

  2. C# DataTable操作,转载

    DataTable 排序   DataRow[] rows = dataTable1.Select("", "ord asc");   DataTable t ...

  3. 3---java中的集合

    集合是什么:表示一组元素的对象,有的是有序的,有的是无序的,有的是可重复的,有的是不可重复的. 首先根是:Collection 1:Set 没有重复元素  SortedSet 有序的Set 2:Lis ...

  4. .net core 使用 Nlog 配置文件

    nlog.config文件 安装nuget包: NLog.Web.AspNetCore 配置开始 <?xml version="1.0" encoding="utf ...

  5. Unity图片转存及读取

    [code]csharpcode: /// <summary> /// 加载图片 /// </summary> private Sprite LoadTexture(strin ...

  6. Spring-纯Java创建一个SSM【webapp】

    纯Java搭建webapp QuickStart 使用纯 Java 来搭建一个 SSM 环境,即在项目中,不存在任何 XML 配置,包括 web.xml 1创建一个Maven工程 引入依赖 <! ...

  7. 快速部署LAMP黄金架构,搭建disuz论坛

    快速部署LAMP架构 [root@zhanghuan ~]# iptables -F[root@zhanghuan ~]# systemctl stop firewalld[root@zhanghua ...

  8. 如何快速弄懂Java线程池

    Java线程池是一种高效的多线程编程技术,它可以帮助程序员有效地控制多线程的并发执行.它可以提高应用程序的性能.降低内存消耗和减少延迟. 线程池的原理是,程序员可以将每个任务放入线程池中,然后由线程池 ...

  9. WebSocket集群解决方案,不用MQ

    ​ 首先不了解WebSocket的可以先看看这篇文章,以及传统的WebSocket方案是怎么做的,https://www.cnblogs.com/jeremylai7/p/16875115.html ...

  10. Java:如何在PowerPoint幻灯片中创建散点图

    散点图是通过两组数据构成多个坐标点,考察坐标点的分布,判断两变量之间是否存在某种关联或总结坐标点的分布模式.散点图将序列显示为一组点,值由点在图表中的位置表示,类别由图表中的不同标记表示,通常用于比较 ...