I was going through an example from Microsoft’s Tim Sneath and hit the following error…
A first chance exception of type ‘System.Windows.Markup.XamlParseException’ occurred in System.Windows.dll
Additional information: AG_E_PARSER_BAD_PROPERTY_VALUE
I dread this sort of error in Silverlight, but it turns out that the answer in this case was fairly simple, if a little suprising. The example has 3 slider controls each sharing the same ValueChanged event handler. However, as the page is initialized the slider values are firing their ValueChanged events. Unfortunatley the shared event handler examines the value of all the controls but they are not yet available, hence the error. To avoid this I simply check for null in the event handler.