Thursday, April 05, 2012

How to fix the xaml bug in Silverlight 4 regarding namespaces

Sometimes, you get a nasty issue when using Silverlight 4. When building your xaml files, you get a compiler error that looks like this:

public partial class ChildDialog : DataWindow { }

"Error 1 The type or namespace name 'DataWindow' could not be found (are you missing a using directive or an assembly reference?)"

This issue occurs when you are using xaml namespaces in the form of an url. For example, when using Catel, all types can be used by including the following xaml:

  xmlns:catel=”http://catel.codeplex.com

You can fix this by following this workflow:

Clean the solution
Remove the catel namespace in the xaml
Save the page
Add the catel namespace again
Save the page
Rebuild the solution

Read more: Geert van Horrik
QR: Inline image 1

Posted via email from Jasper-Net