利用prism实现ViewModel之间通讯的例子

上传者: qing2005 | 上传时间: 2021-06-22 08:56:13 | 文件大小: 359KB | 文件类型: RAR
WPF中时常会遇到ViewModel之间的通讯,ViewModel并不知道自己的View,但是一个View发生的更改需要通知另外一个View。 举一个例子,软件界面上有个人信息,打开一个界面更改用户的信息后,这时显示个人信息的地方理应发生变化。此场景下更改用户后应该通知另一个显示用户信息的区域去更新。一般在设计时,我们会设计成一个个的用户控件,用户控件的数据来源于ViewModel,所以此时需要ViewModel之间通讯。

文件下载

资源详情

[{"title":"( 68 个子文件 359KB ) 利用prism实现ViewModel之间通讯的例子","children":[{"title":"PrismEventDemo","children":[{"title":"LeftContainerViewModel.cs <span style='color:#111;'> 1.35KB </span>","children":null,"spread":false},{"title":"RightContainer.xaml.cs <span style='color:#111;'> 675B </span>","children":null,"spread":false},{"title":"bin","children":[{"title":"Debug","children":[{"title":"Microsoft.Practices.ServiceLocation.xml <span style='color:#111;'> 16.44KB </span>","children":null,"spread":false},{"title":"Microsoft.Practices.Unity.xml <span style='color:#111;'> 354.40KB </span>","children":null,"spread":false},{"title":"Microsoft.Practices.Prism.UnityExtensions.pdb <span style='color:#111;'> 29.50KB </span>","children":null,"spread":false},{"title":"PrismEventDemo.vshost.exe.manifest <span style='color:#111;'> 490B </span>","children":null,"spread":false},{"title":"PrismEventDemo.vshost.exe <span style='color:#111;'> 11.33KB </span>","children":null,"spread":false},{"title":"Microsoft.Practices.Prism.UnityExtensions.dll <span style='color:#111;'> 24.30KB </span>","children":null,"spread":false},{"title":"Microsoft.Practices.Prism.dll <span style='color:#111;'> 147.30KB </span>","children":null,"spread":false},{"title":"Microsoft.Practices.Unity.dll <span style='color:#111;'> 130.80KB </span>","children":null,"spread":false},{"title":"Microsoft.Practices.ServiceLocation.dll <span style='color:#111;'> 29.06KB </span>","children":null,"spread":false},{"title":"PrismEventDemo.exe <span style='color:#111;'> 18.00KB </span>","children":null,"spread":false},{"title":"Microsoft.Practices.Prism.pdb <span style='color:#111;'> 473.50KB </span>","children":null,"spread":false},{"title":"Microsoft.Practices.Prism.UnityExtensions.xml <span style='color:#111;'> 16.20KB </span>","children":null,"spread":false},{"title":"PrismEventDemo.pdb <span style='color:#111;'> 71.50KB </span>","children":null,"spread":false},{"title":"Microsoft.Practices.Prism.xml <span style='color:#111;'> 376.20KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"Bootstrapper.cs <span style='color:#111;'> 431B </span>","children":null,"spread":false},{"title":"obj","children":[{"title":"x86","children":[{"title":"Debug","children":[{"title":"MainWindow.g.cs <span style='color:#111;'> 3.26KB </span>","children":null,"spread":false},{"title":"GeneratedInternalTypeHelper.g.i.cs <span style='color:#111;'> 2.85KB </span>","children":null,"spread":false},{"title":"CenterContainer.baml <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false},{"title":"PrismEventDemo_MarkupCompile.cache <span style='color:#111;'> 341B </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferences.cache <span style='color:#111;'> 42.52KB </span>","children":null,"spread":false},{"title":"MainWindow.baml <span style='color:#111;'> 1.11KB </span>","children":null,"spread":false},{"title":"RightContainer.g.i.cs <span style='color:#111;'> 3.40KB </span>","children":null,"spread":false},{"title":"PrismEventDemo_MarkupCompile.i.lref <span style='color:#111;'> 297B </span>","children":null,"spread":false},{"title":"MainWindow.g.i.cs <span style='color:#111;'> 3.26KB </span>","children":null,"spread":false},{"title":"LeftContainer.g.i.cs <span style='color:#111;'> 3.80KB </span>","children":null,"spread":false},{"title":"GenerateResource.read.1.tlog <span style='color:#111;'> 160B </span>","children":null,"spread":false},{"title":"PrismEventDemo.csproj.FileListAbsolute.txt <span style='color:#111;'> 2.80KB </span>","children":null,"spread":false},{"title":"App.g.cs <span style='color:#111;'> 1.73KB </span>","children":null,"spread":false},{"title":"LeftContainer.baml <span style='color:#111;'> 1.41KB </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferencesInput.cache <span style='color:#111;'> 6.60KB </span>","children":null,"spread":false},{"title":"PrismEventDemo.Properties.Resources.resources <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"CenterContainer.g.cs <span style='color:#111;'> 3.41KB </span>","children":null,"spread":false},{"title":"PrismEventDemo.exe <span style='color:#111;'> 18.00KB </span>","children":null,"spread":false},{"title":"RightContainer.g.cs <span style='color:#111;'> 3.40KB </span>","children":null,"spread":false},{"title":"LeftContainer.g.cs <span style='color:#111;'> 3.80KB </span>","children":null,"spread":false},{"title":"TempPE","children":[{"title":"Properties.Resources.Designer.cs.dll <span style='color:#111;'> 4.50KB </span>","children":null,"spread":false}],"spread":false},{"title":"PrismEventDemo_MarkupCompile.i.cache <span style='color:#111;'> 341B </span>","children":null,"spread":false},{"title":"PrismEventDemo.pdb <span style='color:#111;'> 71.50KB </span>","children":null,"spread":false},{"title":"CenterContainer.g.i.cs <span style='color:#111;'> 3.41KB </span>","children":null,"spread":false},{"title":"GenerateResource.write.1.tlog <span style='color:#111;'> 384B </span>","children":null,"spread":false},{"title":"PrismEventDemo.g.resources <span style='color:#111;'> 5.47KB </span>","children":null,"spread":false},{"title":"PrismEventDemo_MarkupCompile.lref <span style='color:#111;'> 297B </span>","children":null,"spread":false},{"title":"GeneratedInternalTypeHelper.g.cs <span style='color:#111;'> 2.85KB </span>","children":null,"spread":false},{"title":"App.g.i.cs <span style='color:#111;'> 1.73KB </span>","children":null,"spread":false},{"title":"RightContainer.baml <span style='color:#111;'> 1.28KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":"LeftContainer.xaml.cs <span style='color:#111;'> 747B </span>","children":null,"spread":false},{"title":"MainWindow.xaml <span style='color:#111;'> 576B </span>","children":null,"spread":false},{"title":"Properties","children":[{"title":"Resources.Designer.cs <span style='color:#111;'> 2.44KB </span>","children":null,"spread":false},{"title":"Settings.settings <span style='color:#111;'> 201B </span>","children":null,"spread":false},{"title":"Resources.resx <span style='color:#111;'> 5.48KB </span>","children":null,"spread":false},{"title":"Settings.Designer.cs <span style='color:#111;'> 1011B </span>","children":null,"spread":false},{"title":"AssemblyInfo.cs <span style='color:#111;'> 2.12KB </span>","children":null,"spread":false}],"spread":true},{"title":"LeftContainer.xaml <span style='color:#111;'> 1000B </span>","children":null,"spread":false},{"title":"MainWindow.xaml.cs <span style='color:#111;'> 578B </span>","children":null,"spread":false},{"title":"CenterContainer.xaml.cs <span style='color:#111;'> 598B </span>","children":null,"spread":false},{"title":"PrismEventDemo.sln <span style='color:#111;'> 869B </span>","children":null,"spread":false},{"title":"CenterContainer.xaml <span style='color:#111;'> 899B </span>","children":null,"spread":false},{"title":"User.cs <span style='color:#111;'> 220B </span>","children":null,"spread":false},{"title":"App.xaml <span style='color:#111;'> 282B </span>","children":null,"spread":false},{"title":"RightContainer.xaml <span style='color:#111;'> 900B </span>","children":null,"spread":false},{"title":"App.xaml.cs <span style='color:#111;'> 447B </span>","children":null,"spread":false},{"title":"CenterContainerViewModel.cs <span style='color:#111;'> 1.16KB </span>","children":null,"spread":false},{"title":"PrismEventDemo.csproj <span style='color:#111;'> 6.30KB </span>","children":null,"spread":false},{"title":"PrismEventDemo.suo <span style='color:#111;'> 44.00KB </span>","children":null,"spread":false},{"title":"UserChangedEvent.cs <span style='color:#111;'> 325B </span>","children":null,"spread":false},{"title":"RightContainerViewModel.cs <span style='color:#111;'> 1.35KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

  • zhoupuxian :
    一般,不过可以为初学者借鉴
    2021-04-14
  • lijin_1994 :
    很棒哦推荐下载
    2019-07-11
  • t584432285 :
    一般般 但谢谢
    2018-10-04
  • xiexin456 :
    不错,比较实用
    2018-10-02
  • qscqsc123456 :
    不错的demo,楼主幸苦
    2017-07-24

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明