Detect Design Time Mode in WPF






4.81/5 (13 votes)
In order to detect whether your application is executing as a result of being in a designer use the GetIsInDesignMode method of DesignerProperties as the following demonstrate.C#bool designTime = System.ComponentModel.DesignerProperties.GetIsInDesignMode( new...
In order to detect whether your application is executing as a result of being in a designer use the GetIsInDesignMode
method of DesignerProperties
as the following demonstrate.
C#
bool designTime = System.ComponentModel.DesignerProperties.GetIsInDesignMode(
new DependencyObject());
VB.NET
dim designTime as Boolean = DesignerProperties.GetIsInDesignMode(
New DependencyObject)