Monday, March 10, 2008

Quick Silverlight tip: If you are unable to debug your own control

If you are unable to debug your own control. If nothing happens when you are using in your code the custom control created. If you do not know what's bad you're doing, and there is no error appears. Know, you should put user controls in other assembly and then reference to the assembly of controls in your project and in xaml code. Like this

<UserControl x:Class="MySilverlightProject.Page"
    xmlns="http://schemas.microsoft.com/client/2007"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:c="clr-namespace:MySilverlightClassLibrary;assembly=MySilverlightClassLibrary"

In this case your controls will work.

No comments: