MVVM Light IsInDesignMode property not working

I am having a problem where the IsInDesignMode property does not return the expected true when running the solution in VS or Blend. My environment consists of Win Server 2008 R2, VS2010 Pro, Blend 4, and MVVM Light V3. I run my Silverlight 4 solution in debug mode from VS and Blend, and IsInDesignMode is always false. Am I missing a setting? Is there a reason she cannot raise the environment? Thanks in advance.

Greg

+4
source share
5 answers

It should work correctly. The only place I know that IsInDesignMode returns the wrong value is to use it to create code that runs in Visual Studio, such as VS plug-ins. This is a problem that is very difficult to solve. It doesn't seem like this is what you do, though ...

Do you have a reproduction that I can check? Or can you download the MVVM Light code and debug this?

Thanks Laurent

+2
source

Have you tried if (IsInDesignModeStatic) {...} ?

0
source

I run my Silverlight 4 solution in debug mode from VS and Blend and IsInDesignMode is always false. Am I missing settings?

IsInDesignMode flags should only be true when run inside a constructor in Visual Studio or Blend. After starting the application in the debugger, the values ​​must be false. This function should be used to develop your ideas inside the designer without having to run the application.

0
source

I came across this myself in Visual Studio 2013. I also opened a project in Blend at the same time. I closed VS2013, closed Blend, reopened in VS 2013, and again everything was right with the world (IsInDesign returned TRUE).

0
source

Kill all XDesProc.exe processes in the task manager, and then click "restart constructor" in visual studio.
This always fixes this for me.

0
source

Source: https://habr.com/ru/post/1316463/


All Articles