Wednesday, April 16, 2008

Cider vs VS2008's builder. Just for fun

I wrote little test sample with using WPF. I added a custom class (inherit from Button) in sample's namespace. I needed to add control in application.

Taking into account my previous work experience with the implement controls, I wrote like next xmlns:local="clr-namespace:WpfApplication1;assembly=WpfApplication1" ,

I confused.

Project didn't build. It saw that couldn't find my custom class in adjusted XML namespace. In this case to my great surprise Cider parsed all correct and show Button in my case (my custom class was inherit from Button) even add correct a method for event handler.

I miss when added full type describe of namespace. In this case I had to write next: xmlns:local="clr-namespace:WpfApplication1"

Note:

If namespace of application set to use XmlnsDefinition (for example: [assembly: XmlnsDefinition( "http://www.mySite.com", "WpfApplication1" )] in AssemblyInfo.cs) and accordingly we must to write xmlns:local="http://www.mySite.com" in app. This sample isn't built and Cider doesn't parse it. We should use like code in an external dll only.

No comments: