How WPF framework handles cyclic update of properties in MVVM?

后端 未结 3 1519
無奈伤痛
無奈伤痛 2021-01-22 16:10

Lets assume property Name is bind to TextBox in view like this.

private string name
public string Name
{
   get {return name;}
   set {
       name=value;
              


        
3条回答
  •  春和景丽
    2021-01-22 16:18

    There is no recursion as far I understand.

    1) TextBox updates the value using viewmodel property.

    2) Viewmodel raises update, letting UI know that something changed

    3) TextBox now updates himself to match the viewmodel value.

提交回复
热议问题