0

I'm have 3 Entries in mij XAML, the first will have a value (let's say 100), the sum of the second and third must equal 100. When the second is being filled in, the third will automatically contain the difference between 100 and the value in the second Entry.

I'm trying to keep my ViewModel as clean as possible with mostly get;set; and nothing else, so I was wondering if it is possible to use a DataTrigger to accomplish this, or do I really need to do this in my ViewModel?

Freerk92
  • 55
  • 1
  • 9
  • 1
    This is logic which does not belong to the view, so I'd say it's better to do that in viewmodel. Suppose you moved your viewmodel to another platform (like android). With trigger you again need to implement the same logic, with viewmodel you do not. – Evk Oct 26 '17 at 09:11

1 Answers1

0

You could use a MultiDataTrigger

But you will still need some properties in your ViewModel or a Converter (what's so bad about it ?).

Felix D.
  • 4,811
  • 8
  • 38
  • 72