kswoll / ReactiveUI.Fody

C# Fody extension to generate RaisePropertyChange notifications for properties and ObservableAsPropertyHelper properties.
MIT License
154 stars 31 forks source link

Watching a nested property #29

Closed buckleyGI closed 7 years ago

buckleyGI commented 7 years ago

As described in "Watching a nested property" on https://docs.reactiveui.net/en/user-guide/when-any/index.html this should work fine:

this.WhenAnyValue(x => x.Foo.Bar.Baz);

However when I use the [Reactive] attribute in my project the changes of the subproperties are not picked up. When I switch to the native way of defining the property with RaiseAndSetIfChanged it works.

So I thought that I stumbled upon an edge case where the fody weaver had a problem with. Making a testproject to isolate the problem did not show the problem. The weaver worked just fine with subproperties. Then I copy pasted the code in the working isolated project in my project and it started failing again. After spending a good half day on it I give up.

I cannot give an isolated project that shows the issue. Is someone willing to look at my project and to see why it works with RaiseAndSetIfChanged and not [Reactive]? I'll try to strip out the database so it's easy to run.

buckleyGI commented 7 years ago

I found the cause of my own error.

Some types were refactored to another assembly and the ReactiveUI weaver was not registred.