Windows Tip: set PerceivedType for .xaml to “text” to get nice preview in explorer
Windows 7 has a preview handler in the Explorer that provides a nice preview for many file types. I noticed the other day that .cs files show up in the preview window. Also, .xaml files didn’t.
I just dug through the registry to figure out how to enable .xaml files to use the same text previewer as .txt and .cs files.
Setting the PerceivedType of the .xaml file format via this .reg file (or by hand in the registry) to “text” will enable this text preview window for you.
Update (12/14/2009): it may also be useful to have this set for .csproj/etc... Modified the .reg file below...
xamlPerceivedType.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xaml]
"PerceivedType"="text"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.csproj]
"PerceivedType"="text"
Visual
- select the XAML file to preview
- the preview pane shows the text for that file
- this button will show/hide the preview pane
- this enables shell actions such as “open” and “open with”
I’ll follow up with the several possible teams that could just set this reg key in .NET Framework or VS or Silverlight or Silverlight SDK to figure out the best one…
[this may work in older versions of windows as well…at home, i don’t have a Vista or XP machine to try it on]