Question

I'm not that good with XAML but I want to have a data-trigger which is bound to a variable on my page.cs which is a double.

If the double is bigger than 0.25, I want it to trigger. If it's 0.5 I want another one to trigger.

How would you do this kind of stuff? Any pages to read up on this would be awesome

Was it helpful?

Solution

You can use converters implementing IValueConverter interface which convert double to bool, based on a value of converter parameter.

For example a converter DoubleMoreThanConverter would accept double value, double converter parameter and return bool in Convert method. You can set Converter and ConverterParameter properties of a binding you put into DataTrigger.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top