This should be very simple, but I can't find it. Currently, I have the following trigger:
<DataTrigger
Binding="{Binding warmed,
Converter={converters:IsGreaterThan 185}}"
Value="False">
As you can see, there is a comparison to a fix value (185), but I'd like this to be variable, so I tried something like this:
<DataTrigger
Binding="{Binding warmed,
Converter={converters:IsGreaterThan
"{Binding MaxMinutes}"
}
}"
Value="False">
(I've added some whitespace for readability reasons.
Although this should be extremely simple, I don't seem to find it.
I tried to convert my situation in a situation, using such a ConverterParameter, but no success:
<DataTrigger Binding="{Binding warmed,
Converter={converters:IsGreaterThan},
ConverterParameter=185}"
Value="False">
This seems not to work. How can I convert my situation in one, using a ConverterParameter?
When opening the "Create Data Binding" dialog box, this is what I see:
As you can see, no trace of that value 185, although it is crucial in my solution. When I fill it in as the ConverterParameter, this is what I get:
<DataTrigger
Binding="{Binding warmed,
ConverterParameter=185,
Converter={converters:IsGreaterThan 185}}"
Value="False">
... and again no way to declare any multibinding (as I couldn't get it done by trying to type it, I tried to get it using the Visual Studio "Properties" editor).
Edit: a new attempt
Again a try, this time trying to introduce the MultiBinding:
<DataTrigger>
<DataTrigger.Binding>
<MultiBinding>
<Binding Path="warmed"/>
<Binding Converter="{converters:IsGreaterThan 185}"/>
<Binding Value="False"/>
</MultiBinding>
</DataTrigger.Binding>
It yields two error messages:
XLS0413 : The property 'Value' was not found in type 'Binding'.
XDG0012 : The member "Value" is not recognised or is not accessible.

The comments are correct that it's not possible to directly use a
ConverterParameterwith a variable using pure XAML. XAML is just inflexible that way.While a
MultiBindingcould be made to work here, I think it's a risky approach (more on that later) and certainly overkill. Instead I would simply handle this at the view model level by defining aboolPOCO propertyWarmEnoughwhose value is derived fromWarmedandMaxMinutes:Then you simply bind your trigger to the
WarmEnoughproperty without regard to converters and the like. (Just make sure you don't need a two-way binding for some reason!) This works because a property change is raised forWarmEnoughwheneverWarmedorMaxMinutesare changed. So theTriggerwill be, er, triggered, whenever either of those properties is changed.Functionally it's the same as a
MultiBinding- inside theConvertmethod of theIMultiValueConverteryou'd basically do the same thing I'm suggesting you do in the getter ofWarmEnough- but the problem is the values will come into the multi-converter as an array ofobjects, whose types you'll need to check and cast, and which will depend on the order of theBindings in the XAML. This could easily trip up future you and/or your successors without explicit documentation. IMOMultiBindingis really best suited for situations when all the values are the same type and the correct order is either obvious or irrelevant, such as doing boolean AND/OR/XOR checks on multiple conditions, concatenating strings together, etc. Of course it could be done this way so perhaps Clemens will be kind enough to show us. But I would stick with the view model based approach and short circuit all of this.