When authoring a control, it's common to include code that must run outside the editor, otherwise it would cause an exception in edit mode.
The following code shows how to do it:
public partial class YourControl: UserControl
{
public YourControl()
{
InitializeComponent();
if (!DesignerProperties.IsInDesignTool)
{
//code to run outside the editor
}
}
}
No comments:
Post a Comment