Mvvm sidekick Win8 RT lightweight mvvm framework Open Source

Source: Internet
Author: User

 

 

Mvvm-sidekick (now for Windows runtime XAML only)

Mvvm friends (currently only Win8 is supported)
  • A modern light-weight mvvm framework based on RX and TPL 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.

    This project is a lightweight mvvm framework based on new technologies such as RX and await. Its core is the viewmodelbase type. You can even take it out and use it with other frameworks.

  • 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. net 4.5 and Windows runtime. it offers a suitable foundation for new tech environment, based on a cool viewmodelbase and reactivecommand.

    The purpose of the project is to combine the advantages of the reactive UI/command, prism and other frameworks. net 4.5 and Windows runtime bring about changes, tailored for the new technology environment to create a set of viewmodelbase/reactivecommand as the core of the Foundation.

  • Mvvm-sidekick is design on Windows 8 modern style apps, and we got that ambition to cover all modern XAML runtime.

    This framework is tested with the Windows 8 style app as the runtime environment from the design stage, and is ambitious to cover all the XAML runtime environments.

What's the point.
Features
  • Full support for data contract serializing. You can keep your status that VM got into JSON and XML. Easy Steps after restore the data to make VM works again.

    Fully supports datacontract serialization. You can save all the statuses of a VM as JSON/XML deserialization in any way, and then restore the job with simple operations.

  • This is light-weight one. dll or code can works in you projects either. You just need install reactive extensions with nuget.

    LightweightCodeLevel framework, you do not need to install all DLL or reference projects, you only need to add the specified code file to your project to switch to install reactive extensions.

  • Model members in mvvm-sidekick are communicated amount each other with events. LINQ-like code with RX can filter/subscribe events easily, and subscricocould be disposed with model involved.

    All members of the model use event sequences to drive interaction. You only need to configure and subscribe to them using the LINQ-like syntax. The subscription is automatically canceled when the VM is destroyed.

  • You can configure business logic of your properties and commands right at where they were declared. this will reduce your jumping between different parts in one VM file. (This kills me when I was working with other frameworks: you cannot configure a delaycommand at the property/field declaration part because "This" instance is not ready yet .)

    You can configure the business details of the property in the declared Property Code, and configure the business details of the command in the declared command code, in this way, you do not need to skip different code segments in a VM. (I am exhausted by using other frameworks. Declaring a command cannot be declared for in-situ initialization, because this has not yet been instantiated)

  • You can also separate the business logic to your VM Declaration into a decorator or factory something, to manage all Code involved a use case together, with the documenting organizing sequence, and you can also easily add more business everywhere if you like.

    The business details configuration of the VM can be separated from the creation time of the VM, and batch configuration can be performed not only in the external decoration mode of the entity (this allows the code to be highly consistent with the Organization order of the requirement document, (easy to maintain). You can also temporarily add VM functions as needed.

Performance
Performance highlights
    • Propery access supports JIT inline and also support property name-value access.> compared with the general dictionary kernel and field kernel, mvvmsidekick vmbase improves the speed of attribute access by using inline direct addressing, and keeps field name dictionary access
Samples
Use Cases

Https://github.com/waynebaby/Table-Game-Sidekick

    • Table game app Based on mvvm-sidekick. not finished -- yet/ever, but it is good to show how mvvm-sidekick works.> table game assistant app Based on mvvm-sidekick. current Progress --- pitfall. but it is a good example.
How to Use Project template? How to Use the mvvmsidekick Project template? Preparation
Preparations
    • Enter mvvmsidekick/nuget Package content folder

      Go to the mvvmsidekick/nuget Package content directory

    • Open mvvmsidekickvsix. vsix, install the extension.

      Open mvvmsidekickvsix. vsix and follow the prompts to install it.

Creating new project
Create a new project
    • Create new project using mvvmsidekick Project template.

      Create a new project and find the mvvmsidekick Project template in the C # project.

    • Create mvvmsidekick items in project.

      Use the mvvm sidekick code template in the created project to create the datamodel and view/viewmodel files.

If you already have one
If a project already exists
    • Open your project.

      Open Project

    • Delete the app. XAML. CS and main page (if you have nothing important in it .)

      Delete app. XAML. CS from the project (if you haven't put any logic in it)

    • Add new item through "app root and main page" item template.

      Create an item using the app root and Main Page Template

Code snippets is needed when you use mvvmsidekick.
This framework requires code blocks for development.

If your "events" folder is not in path "C: \", the nuget installation might not working properly. Please install the snipplet mamually inTools-> code snippletsMenu. default path is

Packages/[mvvmsidekick folder]/mvvm. snippet

If your "document" folder is not on the C: disk installed by default, nuget's automatic installation may fail to be positioned correctly.Tools> code snippetsTo add the path:

Packages/[mvvm close friend path]/mvvm. snippet

Supported snippets:

The following common code blocks are supported:

Propvm New propery in Model Add attributes to mvvmsidekick binable/viewmodel
Vmcmd New command in Model Add the command to mvvmsidekick binable/viewmodel

Example:

 
> Propvm + TAB + Tab

Owner: waynebaby

Ping me:

Weibo mail

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.