WPF中判断是否处于设计模式

在WPF中,有时需要判断当前是否处于设计模式,以屏蔽设计器执行构造函数里面的部分功能

    public static bool IsInDesignMode(this Control control)
    {
        return System.ComponentModel.DesignerProperties.GetIsInDesignMode(control);
    }

原文地址:https://www.cnblogs.com/TianFang/p/2404659.html