Closed kgc00 closed 3 years ago
@kgc00
FromObject
method works as 'one way to source binding'.
In this case, the source is SomeModel class, the target is the Reactiveproperty instance.
If you want to sync between SomeModel
and ReactiveProperty
, then you have to implement INotifyPropertyChanged
interface to SomeModel
, and then change ReactiveThing
class like below:
public class ReactiveThing {
public ReactiveProperty<int> rpInt { get; private set; }
public SomeModel Model;
public ReactiveThing() {
Model = new SomeModel();
// ObserveProperty is defined as an extension method of INotifyPropertyChanged interface
rpInt = Model.ObserveProperty(x => x.someInt).ToReactiveProperty();
}
}
@kgc00 I have created a sample project. Please check the following link: https://github.com/runceel/Issue212/blob/master/Issue212/UnitTest1.cs
Hi @runceel,
I see now what I was doing wrong. Thanks for the help!
@kgc00 No problem.
Hi,
Is it possible to Unit Test reactive properties? I've got a simple sandbox with:
But my test fails with:
Do tests need to be structured in some kind of way to facilitate reactive proprty updates?