Fear Blend 2 and keep your Xaml dry
Okay, I like Blend 2, but it has its tricks..
A control’s xaml when was loaded in its constructor threw a Catastrophic failure.
I designed the control in Blend 2 without touching the xaml’s source. It was a pretty simple graphic, four rectangles in a canvas.
All had unique names so the problem wasn’t related to namescopes.
To cut a long story short it occurred to me, that one rectangle had three spaces after the value in its height property. Fixing this solved the problem.
The full Exception info after the jump.
Error:
System.Exception was caught
Message=”Catastrophic failure (Exception from HRESULT: 0×8000FFFF (E_UNEXPECTED))”
StackTrace:
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
at System.Windows.XamlReader.MethodExForXaml(IntPtr objectPointer, String methodName, String xaml, Boolean createNamescope)
at System.Windows.Controls.Control.InitializeFromXaml(String xaml)
at DWMSystem.Browser.HTMLOverlayControl..ctor()
at HTMLBarInSL.Page.Page_Loaded(Object o, EventArgs e)
InnerException: null
Solution: Removing the spaces form Height property
<Rectangle Width="640" Height=”10 “ Canvas.Left=”0″ Canvas.Top=”0″ x:Name=”TopBorder”>
[…] Reading in Xaml throws Catasthrophic failure Post a comment | Trackback URI […]