DEV Community

Alexey
Alexey

Posted on

Answer: Getting prior value on change of property using ReactiveUI in WPF MVVM

How about this:

 this.WhenAnyValue(vm => vm.AccountHolderType) .Buffer(2, 1) .Select(b => (Previous: b[0], Current: b[1])) .Subscribe(t => { //Logic using previous and new value for AccountHolderType }); 

I think you have missed this straight forward Buffer function.

Top comments (0)