Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to utilize reactive extensions (Rx) in calculated properties

$
0
0

How to utilize reactive extensions (Rx) to solve a simple UI problem with calculated properties. 

User interface is the following:

User can enter integer value in each textbox and application's job is to calculate properties so that A+B=C is always true.

The following rules must be applied when calculating the properties:

- when A is changed, B is updated (B=C-A)

- when B is changed, C is updated (C=A+B)

- when C is changed, B is updated (B=C-A) 

- viewmodel must have the A,B,C properties

- view as xaml and data binding must be used (RaiseAndSetIfPropertyChanged)

- no code behind

- Rx observer/subscriber must be utilized (WhenAny, WhenAnyValue, etc)


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>