Solution - XamlParseException [Line : 0, Position 0] in Expression Blend Design Mode

2 posts, 0 answers
  1. IsolatedStorage
    IsolatedStorage avatar
    15 posts
    Member since:
    Sep 2009

    Posted 08 Dec 2010 Link to this post

    I have been using the MVVM Light Toolkit with the the Telerik Silverlight controls (v. 2010.2.924.1040) and occasionally when I opened my Views in Expression Blend 4 I would get an XmlParseException error in the Design View. Sometimes it would be fine, but mostly I would get this, or a similar exception.

    Its been bugging me on and off for a couple of weeks but couldn’t really find an answer. I then came across this article - http://blog.roboblob.com/2010/01/17/wiring-up-view-and-viewmodel-in-mvvm-and-silverlight-4-blendability-included/ - which gave me some more details about the IsInDesignMode property. When I started using the MVVM toolkit I ignored this property at first as I didn’t think it was necessary to what we were doing, however I should have read the manual! (http://geekswithblogs.net/lbugnion/archive/2009/09/05/detecting-design-time-mode-in-wpf-and-silverlight.aspx)
    . It turns out, that for MVVM, this property is quite important as Blend will run part of your code to render the SL elements at design time.

    Having read the manual (doh!) and implemented the IsInDesignMode property within my ViewModel constructors Blend is now playing nicely again. I hope this helps others in similar situations?

  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 10 Dec 2010 Link to this post

    Hello IsolatedStorage,

    You ended up with the correct conclusion. When you drag a control into the Blend surface it will actually execute some code from it. That will lead to some problems as probably no data will be loaded or not valid measures. That is the purpose of the IsInDesignMode property.

    All the best,
    Kaloyan
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
Back to Top