In ReactiveUI is it possible to with WhenAnyValue to get base class dependency properties

StackOverflow https://stackoverflow.com/questions/22944838

Вопрос

I may be doing this wrong (TM), but I have a data object that is derived off a interface, then a base class which implements the interface as dependency properties.

When using WhenAnyValue it goes off and checks for the field:

type.GetRuntimeFields().FirstOrDefault(x => x.Name == propertyName + "Property" && x.IsStatic);

The problem of course is that "GetRuntimeFields" don't understand about the static fields through the reflection as by default unless you are using the BindingFlags.FlattenHierarchy flag it won't find it (which GetRuntimeFields won't do)

Is there a way to specify the DependencyProperty directly for WhenAnyValue?

I am using ReactiveUI 5.5.0.0

Thanks, Glenn

I came up with a solution that worked for me, that is to create my own ICreatesObservableForProperty and registering it in my application constructor with the RxApp. This allowed me the flexible of what I wanted to do.

Это было полезно?

Решение

We figured out that this is a bug introduced in ReactiveUI 5.5, that is now fixed as of today :) Upgrade to 5.5.1 and this should go away.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top