How to validate multiple controls as a combined entity?

My application often has a situation in which validation must take into account the combined values of a more than one control. Not just validating more than one control in sequence, but actually considering the combined value of the 2 controls.

I've hacked together some code to use the new validation primitive to validate the individual controls, but need a clean way to consider them as a combined entity. Really, I need to pass multiple values into the "Validate" logic.

For Example:

Control A) contains a value. - let's say 95.300

Control B) contains a unit of measure (let's say mm, cm, m).

Obviously the meaning (and by extension the valid range) of the value in control A) is affected by the value in control B), they can't be validated individually. If the maximum allowed value is 1 meter, then the value is only valid if mm or cm are specified.

Question:

How would I tackle this in XAML/code behind, more specifically, how can I declare (in Xaml) and implement (in code behind) a validation object that is given more than one value to validate?

Any thoughts or suggestions?

Thanks

[1177 byte] By [NickNotYet] at [2007-12-23]

Visual Studio Orcas

Site Classified