MVVM - implementing 'IsDirty' functionality to a ModelView in order to save data

前端 未结 7 1451
攒了一身酷
攒了一身酷 2021-02-04 07:13

Being new to WPF & MVVM I struggling with some basic functionality.

Let me first explain what I am after, and then attach some example code...

I have a scree

7条回答
  •  孤街浪徒
    2021-02-04 08:05

    If you wanted to take a framework approach rather than writing the infrastructure yourself, you could use CSLA (http://www.lhotka.net/cslanet/) - Rocky's framework for developing business objects. Object state is managed for you on property changes, and the code base also includes an example ViewModel type which supports an underlying model, a Save verb, and a CanSave property. You may be able to take inspiration from the code, even you didn't want to use the framework.

提交回复
热议问题