Fear Blend 2 and keep your Xaml dry

code, silverlight — Szili @ 10:15 am

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”>

1 Comment »

  1. […] Reading in Xaml throws Catasthrophic failure Post a comment | Trackback URI […]

    Pingback by Silverlight Emotional Handbook < Szili — January 30, 2008 @ 10:19 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2010 Szili | powered by WordPress with Barecity