Is there a DesignMode property in WPF?

Indeed there is:

System.ComponentModel.DesignerProperties.GetIsInDesignMode

Example:

using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;

public class MyUserControl : UserControl
{
    public MyUserControl()
    {
        if (DesignerProperties.GetIsInDesignMode(this))
        {
            // Design-mode specific functionality
        }
    }
}

Leave a Comment