Considering you have an MVVM Architecture in WPF like Josh Smith’s examples
How would you implement two properties ‘synced’ that update eachother? I have a Price property, and a PriceVatInclusive property in my model.
-When the Price changes, I want to see the Vat inclusive price to automatically be ‘Price * 1.21’.
-Vice versa, when the PriceVatInclusive changes, I want the Price to be ‘PriceVatInclusive / 1.21’
Any ideas on that?
And what if your model is a Entity framework entiry? You can’t use the approach above then… no? Should you put calculating code in the ViewMOdel or … ?
One way:
If you can derive from DependencyObject, you can use Dependency Properties.