最简单的MVVM结构(学习)
Model
M_Object{
A
B
}
View
Show_A
Show_B
Save_Button
VModel
VM_A binding to Show_A
VM_B binding to Show_B
VM_Object
{
M_Object ownObject;
property VM_A {get; set;}
property VM_B {get; set;}
}
void Save()
{
M_Object.A = VM_A;
M_Object.B = VM_B;
}
void Load() //initialize Model call load function
{
VM_A = M_Object.A;
VM_B = M_Object.B;
}