So i have simple Gauge
class with static int
property that implement Propertychanged
:
TotalPacketsSent
T
You're casting the value
argument as an int
and then not using it.
I imagine what you're looking for is something like (deriving from IMultiValueConverter
rather than IValueConverter
):
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
double totalPacketsSent = (double)values[0];
double totalPacketsInList = (double)values[1];
// further validation for handling divide by zero, etc. may need to go here
return totalPacketsSent / totalPacketsInList * 100
}
And in the XAML: