最简单的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;
}





posted @ 2013-03-19 23:47  若愚Shawn  阅读(198)  评论(0编辑  收藏  举报