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

前端 未结 7 1448
攒了一身酷
攒了一身酷 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 07:48

    I would suggest you to use GalaSoft MVVM Light Toolkit as it is much more easier to implement than DIY approach.

    For dirty reads, you need to keep the snapshot of each fields, and return true or false from UserSaveCanExecute() method, which will enable / disable command button accordingly.

提交回复
热议问题