poco - WPF triggers or ViewModel INotifyPropertyChanged -
i making wpf datagrid lots of related columns. when change x, y should x + z. etc. first idea in viewmodel properties inotifypropertychanged. see can done wpf triggers.
imho
if viewmodel/inotifypropertychanged there problem first time initializing, not want these rules execute. guess come around setting private variables in constructor. wpf trigger solution seems more complex , more difficult test.
question
are there advantages letting wpf triggers job?
you've asked bit of subjective question here without possibility of definitive answer. however, i'm going give try.
in opinion, manipulate data in view model, 2 main reasons:
- data manipulation = business rules , belongs in view model , not view
- you have access every property of data item(s) , every method in .net in view model, access little in
trigger.
i hope helps in small way.
Comments
Post a Comment