
正文
WPF封装控件时 检测是否在设计模式中
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
原文:WPF封装控件时 检测是否在设计模式中
版权声明:本文为博主原创文章,未经博主允许不得转载。https://blog.csdn.net/Vblegend_2013/article/details/81984986
public static bool IsDesignMode(this Control ctl)
{
return System.ComponentModel.DesignerProperties.GetIsInDesignMode(ctl);
}
在控件和窗口的构造函数 或 load 中 this.IsDesignMode() 返回当前是否在设计模式








