Tech Off Post

Single Post Permalink

View Thread: Philosophical INotifyPropertyChanged question
  • User profile image

    It's a good question indeed but I do have a few concerns with the design of the properties you're describing. If setting one property causes another property's value to be changed as well, this is pretty much to be considered as a side-effect and maybe a property isn't the best choice in that case (in more complicated situations you'll have to make sure you're not causing a cycle in the chain of setter calls). For more info, check the Framework Design Guidelines on Choosing Between Properties and Methods.

    Nevertheless, there's no silver bullet to this kind of problems - the one thing that's key is to be consistent. Concerning your WPF sample, I'd rely on the SelectedWidget property to become null automatically.