Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I force Visual Studio design view to render with Classic theme?

My problem is as follows:

I design my WPF application in Visual Studio 2010 on Windows 8. I know that the application is only going to be used in Windows XP classic mode.

What I'm seeing in the design view of Visual Studio doesn't match my eventual results on Windows XP. The font is a tad different and therefore some textboxes end up too small or too big.

Is there any way to force Visual Studio's design view to use Windows XP's classic theme instead of the one from my current OS or the most modern one it is able to use?

I've tried the following:

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

No luck however.

like image 671
Davio Avatar asked Mar 21 '13 15:03

Davio


1 Answers

I think you need to use Expression Blend to get the design time view rendered with the Classic theme. It is more advanced than the designer available in VS 2010. The xaml designer in VS 2012 is updated to have more of the advanced features from Blend and also to support rendering with a specified theme at design time inside Visual Studio.

So if you need WYSIWYG designer with Classic theme you can do it by using Blend and a resource like:

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

The designer result in Blend then looks like this (Blend for Visual Studio 2012):

screeenshot from Blend

To make it a bit clearer regarding the differences between VS 2010 and VS 2012:

  • VS 2010 WPF designer is limited, if continuing with 2010 you will need to use Expression Blend to get the real theme in design mode
  • VS 2012 has a new better WPF designer that is based on Blend
  • Blend for VS 2012 is delivered with VS 2012 but is limited to ModernUI projects in the RTM version
  • Blend for VS 2012 needs Update 2 (currently CTP 4 is avaliable) to handle WPF projects for desktop applications as lordcheeto says in his comment
like image 128
Per Salmi Avatar answered Nov 03 '22 06:11

Per Salmi