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)