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

Tagged as

Go to top

Detect Design Time Mode in WPF

, 24 Mar 2010
Rate this:
Please Sign up or sign in to vote.
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)

License

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

Share

About the Author

Daniel Vaughan
President Outcoder
Switzerland Switzerland
Daniel Vaughan is a Microsoft MVP and co-founder 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 WPF, WinRT, and Windows Phone.
 
Daniel is the author of Windows Phone 8 Unleashed and Windows Phone 7.5 Unleashed, both published by SAMS.
 
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
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
GeneralMy vote of 5 Pinmemberzzfima28-Oct-12 21:33 
GeneralRe: My vote of 5 PinmemberDaniel Vaughan28-Oct-12 23:52 
GeneralMy vote of 5 Pinmemberthierry_anthony19-Jul-12 6:09 
GeneralRe: My vote of 5 PinmemberDaniel Vaughan28-Oct-12 23:54 
Glad it was useful to you! And sorry for the delay in responding.
 
Cheers,
Daniel
Daniel Vaughan
Twitter | Blog | Microsoft MVP | Projects: Calcium SDK, Clog | LinkedIn

QuestionSolution for Silverlight and WP7 PinmemberNasenbaaer23-Mar-12 10:29 
AnswerRe: Solution for Silverlight and WP7 [modified] PinmemberPankaj Nikam6-Dec-13 0:11 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 24 Mar 2010
Article Copyright 2010 by Daniel Vaughan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid