You play hero, and I play cute!
MVVM跟班兒
你作英雄炫酷霸,我在一旁萌萌噠
-
MVVM-Sidekick: A Modern light-weight MVVM framework based on RX and TAP await. The CORE of this framework is ViewModelBase Type which you can use it with this framework, or use it with other framework, as well.
本項目是一個基於RX與 await等新技術的輕量級MVVM框架。其核心是ViewModelBase類型,你甚至可以把它拿出去和別的框架一起使用。
-
The aim of this project: This project has learned a lot of good ideas from Prism and Reactive UI/Command project, and it is using new techs offered by .Net 4.5 and Windows Run-time. It offers a suitable foundation for new tech environment, based on a cool ViewModelBase and ReactiveCommand.
項目的目的:集合 Reactive UI/Command, Prism 等框架的優點,應對.Net 4.5 和 Windows Run-time 帶來的變化,為新技術環境量身打造一套以 ViewModelBase/ReactiveCommand 為核心的基礎。
-
MVVM-Sidekick is design on Windows 8 Modern Style Apps, and we got that ambition to cover all modern XAML run-time.
本框架從設計開始就以Windows 8 Style App作為運行環境進行測試,野心覆蓋所有XAML運行環境。
Resources
F.A.Q. goes HERE
F.A.Q. 請戳 這邊
Chinese course provided by community - Thanks @黑芝麻的糊 for your contribution.
中文教程感謝@黑芝麻的糊 的貢獻
Projects in Real-World
案例
-
Open source projects
開源項目
WP-ShanghaiFilmCenters by Edi_Wang
上海影城查詢
-
Close source projects
閉源項目
What make difference?
功能特色
-
Full support for Data Contract Serializing. You can easily save your status of View Model to JSON or XML stream, and easily restore from, too.
全面支持Data Contract序列化 可以將一個VM的全部狀態用任何方式保存為JSON/XML,反序列化后只需要簡單操作就可以恢復工作
-
This is light-weight framework. You can use our dll or use code file, either way you just need to install Reactive Extensions with Nuget.
輕量級框架,不必安裝全部DLL或者引用工程,只需要將指定代碼文件加入你的工程切安裝Reactive Extensions就可以用。
-
Each of Model Properties in MVVM-Sidekick has it's own event container, can subscribe or broadcast it self. LinQ-Like code with RX can be used.
Model所有的成員都有自己的事件容器,可以獨立與其他事件訂閱與廣播。可以使用 LinQ-Like 語法進行配置和訂閱。
-
You can configure business logic of your properties and commands where they were declared. This will avoid your jumping between different parts in one View Model code file. (This kills me when I was working with other frameworks: for example you cannot configure a
DelayCommand
at the Property/Field declaration because “this” instance is not ready yet .)您可以在聲明property的代碼處配置property的業務細節,可以在聲明command的代碼處配置command的業務細節,這樣你就不用在一個VM里面不同的代碼段跳來跳去了。(用別的框架可累死我了,聲明個command 還不能在聲明原地初始化,因為this還沒有實例化)
-
You can also separate the business logic to your View Model declaration into a decorator factory or something else, to manage all code involved one same USE CASE together, with the sequence same as document you a following. You can also easily add more business logic anywhere you like.
您也可以將VM的業務細節配置與VM的創建時機分離,不但可以在實體外用裝飾模式進行批量配置(這樣可以讓代碼與需求文檔的組織順序高度統一,便於維護),也可以根據需要臨時裝飾增加VM的功能。
Samples
示例
In Nuget folder
\src\Samples.zip
or here
How To Use project template ?
如何使用MVVMSidekick項目模板?
See document: Hello world
詳情見文檔 跟班問世篇
Documents TOC
文檔目錄
- Hello world 跟班問世篇
-
View Models (Part 1) View Models(第1部分)
-
View Models (Part 2) View Models(第2部分)
Owner: Waynebaby
Ping Me: