1

I have been using NotifyProperyWeaver and noticed it is deprecated in the latest build to Fody using PropertyChanged.Fody.

I had NotifyProperyWeaver to only weave the properties i had attributes on and all other notifying was disabled.

Is there a way to configure PropertyChanged.Fody such that only [attributed] properties get weaved? and not the reverse. I don't see any info in the documentation page on it, is there a hidden property in the FodyWeavers.xml

<?xml version="1.0" encoding="utf-8"?>
<Weavers>
  <PropertyChanged />
</Weavers>
buckley
  • 13,690
  • 3
  • 53
  • 61
maxfridbe
  • 5,872
  • 10
  • 58
  • 80

1 Answers1

0

This question was also asked here https://github.com/Fody/PropertyChanged/issues/5 and from that issue...

PropertyChanged.Fody makes the assumption that if you implement INotifyPropertyChanged then you would most likely want to notify for most, if not all, properties. If you wish to exclude them, which should be the exception not the rule, then you can add a [DoNotNotifyAttribute] to a class or a property. see here for more details https://github.com/Fody/PropertyChanged/wiki/Attributes

Simon
  • 33,714
  • 21
  • 133
  • 202
  • That's a really bad assumption – Eugene Strizhok Feb 08 '14 at 09:12
  • @EugeneStrizhok why? where is no perf overhead – Simon Feb 08 '14 at 10:34
  • Well. I may have overreacted. :) But I see a rather frequent case when automatic notification is introduced to an existing project, and one may not wish to go through all types implementing INotifyPropertyChange in order to adapt them. In this case it will be desirable to be to set Fody.PropertyChanged behavior in a such way, that it will only weave explicitly marked classes. – Eugene Strizhok Feb 08 '14 at 11:26
  • As far I as remember, NotifyPropertyWeaver had such an option. – Eugene Strizhok Feb 08 '14 at 11:27
  • @EugeneStrizhok correct NotifyPropertyWeaver had such an option. but that that a legacy option due to the evolution of NPW. it was never a conscience design decision. so in the reboot with PropertyChanged.Fody it was removed. And the amount of code to support that feature was non-trivial so it was removed. – Simon Feb 09 '14 at 00:28