WPF : Checking for Design Mode

Created 03 May 2012 09:58
In code, you can check to see if your component is in design mode with the following code:
if (!DesignerProperties.GetIsInDesignMode(this))
    // do stuff
This is useful when you want to add code in the constructor that won't work when rendering at design-time.