Это одно и то же
IsInDesignTool
msgstr "истина, если элемент работает в контексте конструктора; в противном случае ложь."
MDSDN IsInDesignTool
GetIsInDesignMode (element)
«Значение свойства IsInDesignMode для элемента.»
MDSDN GetIsInDesignMode (элемент)
ОДНАКО раз в каждую голубую луну Visual Studio дает сбой
DesignerProperties.GetIsInDesignMode(this)
Так что лучше всего использовать
return DesignerProperties.GetIsInDesignMode(this) || DesignerProperties.IsInDesignTool;
Если вы не хотите, чтобы он когда-либо падал.
.Net Отражатель для Silverlight
public static bool GetIsInDesignMode(DependencyObject element)
{
if (element == null)
{
throw new ArgumentNullException("element");
}
bool flag = false;
if (Application.Current.RootVisual != null)
{
flag = (bool) Application.Current.RootVisual.GetValue(IsInDesignModeProperty);
}
return flag;
}
public static bool IsInDesignTool
{
get
{
return isInDesignTool;
}
[SecurityCritical]
set
{
isInDesignTool = value;
}
}
internal static bool InternalIsInDesignMode
{
[CompilerGenerated]
get
{
return <InternalIsInDesignMode>k__BackingField;
}
[CompilerGenerated]
set
{
<InternalIsInDesignMode>k__BackingField = value;
}
}