Freigeben über


DesignerProperties.GetIsInDesignMode_ForRealz [How to: Reliably detect Silverlight design mode in Blend and Visual Studio]

**

This blog has moved to a new location and comments have been disabled.

All old posts, new posts, and comments can be found on The blog of dlaa.me.

See you there!

Comments

  • Anonymous
    February 26, 2009
    PingBack from http://blogs.msdn.com/delay/archive/2009/02/26/designerproperties-getisindesignmode-forrealz-how-to-reliably-detect-silverlight-design-mode-in-blend-and-visual-studio.aspx

  • Anonymous
    February 27, 2009
    In this issue: Chris Cavanagh, David Anson, Walt Ritscher, and Kevin Dockx. Note: The next few days may

  • Anonymous
    June 11, 2010
    Here's what I'm using...    /// <summary>    /// Are we in design time?    /// </summary>    /// <returns></returns>    public static bool IsDesignTime    {      get      {        try        {          if (System.Windows.Application.Current == null) return true;          if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(            System.Windows.Application.Current.RootVisual))          {            return true;          } //if          var host = System.Windows.Application.Current.Host.Source;          return false;        }        catch        {          return true;        } //try      } //get    }