by preishuber via Hannes Preishuber on 8/11/2008 5:40:29 AM
Databinding with XAML is a lot of work. There is no drag drop table wizard, don’t search for it. Expression Blend (2.5) have a little bit more automatic support for binding Objects. When Blend is in Design View there is under Project tab a Data tab.
Step1: open + CLR Object option- then you get a error message “loading assembly” which can be ignored (what else?)
In the next dialog the class have to be selected which returns the data.
In my case I got 100 times an error in Blend. The exception says nothing for me.
Step 2: Debugging
Expression Blend tries to create a instance of my object during design time. That's a risk cause many parameters can differ to run time like, connections string, database, path and so one.
First there must be some split between design and runtime code. There is a trick to do that. If no htmlpage is present, the container must be something else. Till now a usual container of silverlight xap applications is a browser (and nothing else)
In this container is Blend. Then attach the Blend process to visual studio debugger. For that visual stuido must be open and the project must be compiled. Take Blend for compiling makes it a little bit easier for me. Dont forget to set breakpoint into your constructor.
In my case the code failes on the load place. The reason is ( now I know it) that i have added the XML file as content to my xap packet. But there is no xap package for blend.
The solution is to include the xml as resource into the assembly and load the xml with following code
Hope this will save you some hour.
Original Post: Bind with Expression Blend: cannot create Instance Exception
The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.