In design mode

WPF project has begun and I have been continuously finding new things. I’m very excited, mainly because what I have accomplished to today. Maybe I will write about it.

Many thanks to fellows like Josh,Karl and Sasha for the knowledge I have acquired from them since Summer 2007.

One of the things I needed, for my next post, is to know if code is running in DesignMode or not.

So here is the class I wrote

public static class Designer
{
    private static DependencyObject dummy = new DependencyObject();
    public static bool InDesignMode
    {
        get { return DesignerProperties.GetIsInDesignMode(dummy); }
    }
}

Explore posts in the same categories: .NET C#, WPF

Tags: ,

You can comment below, or link to this permanent URL from your own site.

One Comment on “In design mode”


  1. [...] In design mode WPF project has begun and I have been continuously finding new things. I’m very excited, mainly because what I have accomplished to today. Maybe I will write about it. Many thanks to fellows like Josh,Karl and Sasha for the knowledge I … [...]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.