Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if i'm in run-time or design time?

Tags:

wpf

I developed some userControl that contain some information check on the 'IsVisible' method ( override method ).

When i using this usercontrol on some window - i see some error because the 'IsVisible' method look for some variable that is set on run-time.

How can i check if I'm in design time and the system is not running ?

Thanks for the help.

like image 837
Yanshof Avatar asked Oct 20 '10 13:10

Yanshof


1 Answers

DesignerProperties.GetIsInDesignMode(this); This would return true if you are in design-time.

like image 185
Prince Ashitaka Avatar answered Sep 21 '22 06:09

Prince Ashitaka