Saturday, April 24, 2010

Silverlight 4 RichTextBox lab

Got the below lab when I was looking for the usage of RichTextBox in Silverlight 4.This gives an idea how to use RichTextBox.

http://channel9.msdn.com/learn/courses/Silverlight4/NewFeatures/RichTextBox/

More labs here

Wednesday, April 21, 2010

Parser internal error: Object writer 'xClassNotDerivedFromElement'

If you are a Silverlight developer there is a chance that you may get the exception “Parser internal error: Object writer 'xClassNotDerivedFromElement'” very rarely which is difficult to track.Even you can’t put break points to track this.As a developer you will google the same.But most probably you will not get any results.

Only thing went wrong here is the namespace.But this is not at all mentioned in any of the exception details.ie The project which you are working on will not have a namespace or somebody in the project might forgot put the namespace in XAML or code files.

So make sure that there is namespace present in the project and the xaml files are correctly mapped to the corresponding code files in the x:Class attribute.

Note : We cannot have Silverlight projects without namespace.

I came to see this exception when one of my colleagues tried to write code which should  compile in both Silverlight 4 and WPF 4.