How to enable injection only for specific class?
Closed this issue · 8 comments
I've read the docs, but i don't know what is namepspace filters. How to enable injection only for MySuperNamespace.Part1.MySuperClass? Should I write something in FodyWeavers.xml?
See https://github.com/Fody/PropertyChanged#notes:
- To scope the rewriting only to specific classes, and not the whole Assembly, you can use the
FilterType
attribute. This changes the general behavior from from opt-out to opt-in. Example:[assembly: PropertyChanged.FilterType("My.Specific.OptIn.Namespace.")]
. The string is interpreted as a Regex, and you can use multiple filters. A class will be weaved, if any filter matches.
I've already read all docs and found it. But I dont know where i should specify it
Wouldn't it be better if only classes with a certain attribute were changed? I know [AddINotifyPropertyChangedInterface], but I want to implement INotifyPropertyChanged myself and leave the rest to Fody.
I want to implement INotifyPropertyChanged myself and leave the rest to Fody.
whats stopping you from doing that?
@SimonCropp
Nothing.
"Note that all classes that implement INotifyPropertyChanged will have property notification injected irrespective of the use of this attribute." (source)
In my opinion it should be opt-in and not opt-out with a filter.
@Basti82b a default had to be picked. u can use the filter syntax to change that default. It wont be changing now. BTW
To be using fody you should be a patron.
I'm using latest Xamarin Forms 4.2.0.778, the latest Fody 6.0 and PropertyChanged weaver 3.13.
I am trying to declare to this line to opt-out in the Assembly file, however PropertyChanged type or namespace could not be found.
I need to do this because it appears that the latest version of ReactiveUI, v10.2.2 and ReactiveUI.Fody 10.2.2 has a conflict.
Visual Studio is telling me that I need to install nuget Microsoft.TeamFoundationServer.ExtendedClient but I cannot seem to install this?!?
Anyone know which nuget I'm supposed to be using?