In Winforms you can say
if ( DesignMode )
{
// Do something that only happens on Design mode
}
is there something like this 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
}
}
}