There are two ways to do this on the C # side (I assume you just don't want to literally port MultiBinding to code, which is really useless if you do this, XAML is always better for this)
- An easy way is to create a ValueChanged event handler for 3 sliders and calculate the sum there and assign the desired property.
2. The second and best way to get closer to them in WPF is to make the MVVM style of the application (I hope you know about MVVM). In your ViewModel class, you will have 3 different properties. And you need another โSumโ property also in the class. The amount will be revalued whenever another property agent is called.
public double Value1 { get { return _value1;} set { _value1 = value; RaisePropertyChanged("Value1"); ClaculateSum(); } } public double Sum { get { return _sum;} set { _sum= value; RaisePropertyChanged("Sum"); } } public void CalculateSum() { Sum = Value1+Value2+Value3; }
source share