在Winforms中,您可以说(使用some slightly unexpected behaviour)
if (DesignMode)
{
// Do something that only happens on Design mode
}
在WPF中,你有
if (DesignerProperties.GetIsInDesignMode(this))
{
// Do something that only happens on Design mode
}
但我很难为缩小的PCL世界找到类似的选项,即Universal应用程序?
答案 0 :(得分:5)
对于通用应用,有:
Windows.ApplicationModel.DesignMode.DesignModeEnabled