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); }


One comment

  1. Pingback: ALEX TO » Blog Archive » In design mode

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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