Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting if the application is in design mode in Windows Phone 7 ViewModel

Is there any way I can detect the designer mode or runtime mode of an WP7 project? Currently I reference Application.Current... in a ViewModel and apparently the View does not like it in designer. The XAML designer throws exception. It works fine in runtime. So I am thinking I can do some if/else in ViewModel to workaround this if I know it's in designer mode.

Thanks!

like image 300
yyff Avatar asked Apr 15 '11 19:04

yyff


2 Answers

Simple. This is the same as it is in Silverlight:

DesignerProperties.IsInDesignTool
like image 193
DevTheo Avatar answered Oct 14 '22 11:10

DevTheo


You mean something like DesignerProperties.IsInDesignTool?

like image 26
ctacke Avatar answered Oct 14 '22 13:10

ctacke