Click here to Skip to main content
Click here to Skip to main content

Detect Design Time Mode in WPF

By , 24 Mar 2010
 

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)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Daniel Vaughan
Software Developer (Senior) Outcoder
Switzerland Switzerland
Member
Daniel Vaughan is a Microsoft MVP and cofounder of Outcoder, a Swiss software and consulting company dedicated to creating best-of-breed user experiences and leading-edge back-end solutions, using the Microsoft stack of technologies--in particular Silverlight, WPF, WinRT, and Windows Phone.
 
Daniel is the author of Windows Phone 7.5 Unleashed, the first comprehensive, start-to-finish developer's guide to Microsoft's Windows Phone 7.5.
 
Daniel is also the creator of a number of open-source projects, including Calcium SDK, and Clog.
 
Would you like Daniel to bring value to your organisation? Please contact

Daniel's Blog | MVP profile | Follow on Twitter
 
Windows Phone Experts

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 5memberzzfima28 Oct '12 - 21:33 
GeneralRe: My vote of 5memberDaniel Vaughan28 Oct '12 - 23:52 
GeneralMy vote of 5memberthierry_anthony19 Jul '12 - 6:09 
GeneralRe: My vote of 5memberDaniel Vaughan28 Oct '12 - 23:54 
QuestionSolution for Silverlight and WP7memberNasenbaaer23 Mar '12 - 10:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 24 Mar 2010
Article Copyright 2010 by Daniel Vaughan
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid