How to make visualization visual studio render using a classic theme?

My problem is this:

I am building my WPF application in Visual Studio 2010 on Windows 8. I know that the application will only be used in Windows XP classic mode.

What I see in the design of Visual Studio does not match my final results in Windows XP. The font is a little different, so some text fields are too small or too large.

Is there a way to force Visual Studio visualization to use the classic Windows XP theme instead of the one from my current OS or the most modern one that it can use?

I tried the following:

<ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/PresentationFramework.Classic;component/themes/classic.xaml" /> </ResourceDictionary.MergedDictionaries> 

Bad luck.

+7
source share
1 answer

I think you need to use Expression Blend to get a design-time view created using the Classic theme. It is more advanced than the designer available in VS 2010. The xaml developer in VS 2012 has been updated to have more advanced features from Blend, as well as support rendering with a specific theme during development within Visual Studio.

So, if you need a WYSIWYG designer with a classic theme, you can do this using Blend and a resource like:

 <Application.Resources> <ResourceDictionary Source="/PresentationFramework.Classic;component/themes/classic.xaml" /> </Application.Resources> 

The result of the constructor in Blend is as follows (Blend for Visual Studio 2012):

screeenshot from blend

To make this a little understandable regarding the differences between VS 2010 and VS 2012:

  • The WPF VS 2010 designer is limited, if you continue from 2010, you need to use Expression Blend to get the real theme in design mode.
  • In VS 2012, the new best WPF designer based on Blend
  • Blend for VS 2012 comes with VS 2012, but is limited to ModernUI projects in the RTM version.
  • Blend for VS 2012 needs update 2 (currently CTP 4 is available) to handle WPF projects for desktop applications, Lordhete says in his comment.
+5
source

All Articles