22 lines
591 B
C#
22 lines
591 B
C#
using System.ComponentModel;
|
|
using System.Windows;
|
|
|
|
namespace HandyControl.Tools
|
|
{
|
|
public class DesignerHelper
|
|
{
|
|
private static bool? _isInDesignMode;
|
|
|
|
public static bool IsInDesignMode
|
|
{
|
|
get
|
|
{
|
|
if (!_isInDesignMode.HasValue)
|
|
{
|
|
_isInDesignMode = (bool)DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement)).Metadata.DefaultValue;
|
|
}
|
|
return _isInDesignMode.Value;
|
|
}
|
|
}
|
|
}
|
|
} |