登录
首页 » .NET » MVVM: 关闭对话框

MVVM: 关闭对话框

于 2022-08-21 发布 文件大小:2.83 MB
0 172
下载积分: 2 下载次数: 1

代码说明:

翻译 maninwest@Codeforge 作者 Cornelius Henning@Codeproject 我学习  MVVM 时遇到一个意外问题,关闭对话框时不如在旧的 WPF 中简单, 尤其是当你想避免背后的代码时。在此示例中,所有代码都在视图的 ViewModel 类中。 使用代码 整个项目是个可下载的 zip 文件。该项目是在Visual Studio 2012 中进行的,针对 .NET 4.5 平台。如要查看演示,请解压缩文件并进行构建。运行时,会显示一个用户,具有一个包含一个按钮的主窗口。单击按钮会打开新的具有两个按钮的对话窗口。单击任何一个按钮会执行有限的代码,然后对话框会关闭。 请注意,为了提高可读性,代码已经少得不能再少了。处理运行时错误的意外手柄也减到最少。如果你要使用此代码,务必要确保最终代码稳健且可处理任何意外或其他错误。 此代码中无使用的约束条件。你可以使用全部或者部分。 实现的说明 对话框的关闭由附加的属性控制。属性设置为 true 时,对话框会关闭。.以下是注册附加事件的代码: using System; using System.Windows; namespace MvvmDialogDemo.AttachedProperty { public static class CloseDialog { public static readonly DependencyProperty DialogResultProperty = DependencyProperty.RegisterAttached("DialogResult", typeof(Boolean?), typeof(CloseDialog),new PropertyMetadata(DialogResultChanged)); private static void DialogResultChanged (DependencyO

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 功能强大的NotePad最新修改!内含打包源代码.
    功能强大的NotePad最新修改!内含打包源代码.-Powerful the latest amendments to NotePad! Package contains the source code.
    2023-04-26 04:05:03下载
    积分:1
  • VB利用SPT(最短作業時間)計算flow time
    應用於生產排程上計算SPT之程式與Code,隨機產生1~500組亂數(可自訂)後,利用SPT(最短作業時間)來排序出所有作業之flow time,並計算出Total flow time與Avg flow time。
    2022-02-20 09:21:03下载
    积分:1
  • 六感彩版论坛
    六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。六感论坛全插件,版本。
    2022-02-26 15:21:32下载
    积分:1
  • 核心银行
    客户关系管理和细节开放核心银行软件。
    2022-10-15 01:35:04下载
    积分:1
  • email example in asp.net using language c#
    email example in asp.net using language c#
    2022-02-26 08:52:04下载
    积分:1
  • AspNetPagermis
    说明:  自动分页控件 自动分页控件 自动分页控件(Automatic paging controls automatic paging controls automatic paging controls)
    2008-11-14 15:02:33下载
    积分:1
  • Open the RS232(2) To open the RS232 the interface
    Open the RS232(2) To open the RS232 the interface
    2023-01-02 23:20:05下载
    积分:1
  • 权限管理系统
    asp.net开源框架,方便大家进行二次开源开发。里面已经有权限管理,用户管理,部门管理等。整个界面很大方美观。很适合开发一些小型的系统。
    2022-07-12 11:08:32下载
    积分:1
  • aspcms-v2.3.5
    ASPCMS是基于ASP+Access(sql2000)开发的网站内容管理系统,提供了简介类模块,新闻类模块,产品类模块,图片类模块,下载类模块。你在使用过程中可选择任意模块来建设您的网站。      适用性:充分考虑公司企业的实际需要,确保功能上较强的实用性。   易用性:用户界面简洁、美观、友好,易于用户操作和使用,操作人员只需简单学习即可掌握。   安全性:安全可靠的权限划分,既考虑信息的共享,又注意信息的保护与隔离。(ASPCMS is based ASP+Access (sql2000) developed web content management system, provides a brief introduction class module, class module news, product category module, image class module, download class module. You can select any module using the process to build your website. Applicability: fully consider the actual needs of companies to ensure that functionally strong practicability. Ease of use: The user interface is simple, beautiful, friendly, easy user operation and use, the operator simply learn to master. Security: safe and reliable division of authority, not only to consider the sharing of information, but also pay attention to information protection and isolation.)
    2013-07-03 11:07:32下载
    积分:1
  • mapx
    mapx操作手册记录mapx的各种属性及方法(mapx operating manual records of the various properties and methods mapx)
    2015-03-31 10:41:49下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载