您的位置:首页 > 编程语言 > C#

C# UserControl 判断是否是设计模式中

2014-10-08 10:04 337 查看
In Windows Forms application, we can use Control.IsInDesignMode or LicenseManager.UsageMode == LicenseUsageMode.Designtime to check whether your code is executing in DesignMode or not. You might wonder how would you do the same in WPF. Fortunately, Cider and Blend offers a similar functionality. You can test the following condition DesignerProperties.GetIsInDesignMode(new DependencyObject()).
http://geekswithblogs.net/mrnat/archive/2007/09/16/115407.aspx
大致意思是说  LicenseManager.UsageMode == LicenseUsageMode.Designtime 这个东东,在WPF下是没办法判断的

要用这个来判断 DesignerProperties.GetIsInDesignMode(new DependencyObject())
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: