bool isDesignerMode=DesignerProperties.GetIsInDesignMode(this);

The code is pretty usefull to avoid your designer crash due some codes you put on control loaded event or constructor.

Advertisements