We have been using Colin Eberhardt’s MultiBinding Converter for Silverlight for quite a while now. It was great until we realized a problem. When the MultiBinding Converter was off screen (hidden), it would throw a binding error stating that it couldn’t convert null to whatever (in our case it was an integer in one converter and FontWeight in another).
The solution is rather easy. Add a property called TargetNullValue to MultiBinding.cs in Colin’s source. There’s no “magic” in this name, you can call it whatever you want. TargetNullValue seems to make the most sense for its purpose in this case, and is the name of the property on the actual Silverlight Binding that we’ll be setting in the next step.
Then, hop over to MulitBindings.cs and change the binding (line 110) to utilize the TargetNullValue property on the binding for the ConvertedValue like so:
Now, when you use the MultiBinding, just fill in the TargetNullValue property, for example:
Now my Debug Output window isn’t filled with needless binding errors!