vbao-MVVM

A library aiming for building an MVVM (or MVFM) project


Licenses
LGPL-2.0/LGPL-3.0
Install
pip install vbao-MVVM==0.3

Documentation

VBAO

A lite library aiming for building an MVVM (or MVFM) project.

δΈ­ζ–‡ReadMe

Install and start

Python

conda activate YOURENV
pip install vbao-mvvm
import vbao

What is MVVM? (briefly)

There are three core components in the MVVM pattern: the model, the view, and the view model. Each serves a distinct purpose. The diagram below shows the relationships between the three components. image mentioned above In addition to understanding the responsibilities of each component, it's also important to understand how they interact. At a high level, the view "knows about" the view model, and the view model "knows about" the model, but the model is unaware of the view model, and the view model is unaware of the view. Therefore, the view model isolates the view from the model, and allows the model to evolve independently of the view. -- MVVM from Microsoft

How does it work?

We implement the data-binding, command-binding and property-change-notification to form an MVVM system.

data-binding & command-binding

property-change-notification

When we make it, the interaction among them is as follows.

Filetree

β”œβ”€β”€ example
β”‚Β Β  β”œβ”€β”€ app
β”‚Β Β  β”œβ”€β”€ model
β”‚Β Β  β”œβ”€β”€ view
β”‚Β Β  β”œβ”€β”€ viewmodel
β”‚Β Β  └── window
β”œβ”€β”€ extern
β”‚Β Β  └── pybind11
β”œβ”€β”€ Lib_VBao
β”‚Β Β  β”œβ”€β”€ python
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ vbao
β”‚Β Β  └── VBAO
β”œβ”€β”€ LICENSE
└── README.md

Special Thanks

Zhejiang-University-GKC/SJDXQcourseware: The courseware of SJDXQ (github.com)