This is a migrated thread and some comments may be shown as answers.

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

1 Answer 133 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
IsolatedStorage
Top achievements
Rank 1
IsolatedStorage asked on 09 Dec 2010, 01:05 AM
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?

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 10 Dec 2010, 10:15 AM
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
Tags
General Discussions
Asked by
IsolatedStorage
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or