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

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())  
posted @ 2014-10-08 10:04  adodo1  Views(423)  Comments(0Edit  收藏  举报