Dec 27, 2012 at 7:03 PM
Edited Dec 27, 2012 at 7:25 PM
I hadn't seen the Set<T> method honestly. We are just getting going with MvvmLight. However, when I switch to using the Set<T> method instead of the method I posted earlier I don't get my UI updating.
A couple of points which may or may not be reasons to add an additional overload to Set or modify the current implementation of the Set method.
- The method I posted calls GetPropertyName on ObservableObject only once whereas the existing implementation of Set<T> will call it twice since it is using the strongly typed version of RaisePropertyChanging and RaisePropertyChanged.
- Using the method I posted doesn't require the use of the field parameter as used in Set<T> so if the user wants to use automatic properties they can.
Maybe I'm not using Set<T> correctly and that is the problem. Do you have an example usage?
*EDIT: When I use Set<T> as suggested I see that the backing field gets updated as expected but my UI never gets updated. Not sure what other information you would need. No special messenger stuff going on in our application.