DesignMode property in WPF
To decide whether window or page in design mode, following is the code which returns boolean value
System.ComponentModel.DesignerProperties.GetIsInDesignMode(this);
.NET, C#, Javascript, ASP.NET and lots more…:)
To decide whether window or page in design mode, following is the code which returns boolean value
System.ComponentModel.DesignerProperties.GetIsInDesignMode(this);
Written by Manish
December 6, 2007 at 12:37 pm
Posted in .NET 3.0
Subscribe to comments with RSS.
Thanks. It helped.
Atul Gupta
February 13, 2008 at 11:46 am
Thanks! I had a user control on a window and the XAML designer wouldn’t show it because of some MVVM logic I had in the user control’s constructor. Now I just wrap the logic with this check and both designer and run-time code are happy!
BillyBob
April 26, 2010 at 11:38 pm
I have a winForm and inside a WPF control, this code does not work for the WPF control.
jora
November 8, 2010 at 6:16 pm