post-refactor clean up
This commit is contained in:
parent
a89b07394f
commit
801e154d15
3 changed files with 3 additions and 13 deletions
|
|
@ -9,6 +9,5 @@ see also: https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/rais
|
|||
BindingSource + INotifyPropertyChanged + DataGridView is the backbone of our implementation. The SortableBindingList (BindingList/BindingSource) automatically subscribes to each entry's NotifyPropertyChanged -- which is why our AsyncNotifyPropertyChanged.NotifyPropertyChanged is needed even though none of our code calls it.
|
||||
|
||||
- Adding or removing an entry to/from this BindingSource automatically updates the UI. No additional code needed.
|
||||
- Updating a field updates the UI via calling NotifyPropertyChanged.
|
||||
|
||||
We break the pattern with updating the book inside of GridEntry. To really follow MVVM, iterate through every bound ("binded"?) field name and call NotifyPropertyChanged. It's much more convenient, quicker, and less error prone to make an exception to MVVM via GridEntry.LibraryBookUpdated => InvalidateRow. The downside is that the view has to wire this up. If we change where in the code we can update the book inside of GridEntry, this dependency will also need to be duplicated in the new place
|
||||
- Calling NotifyPropertyChanged with the name of a field updates that field in the UI
|
||||
- Calling NotifyPropertyChanged without a field name (or with an invalid field name) updates the whole entry in the UI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue