Welcome to WindowsClient.net | My Blog | Sign in | Join

Rob Relyea - XAMLified

WPF, Silverlight and XAML

Syndication

Sponsors





  • advertise here
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

xamlFileInExplorer

  1. select the XAML file to preview
  2. the preview pane shows the text for that file
  3. this button will show/hide the preview pane
  4. 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]

Published Friday, August 21, 2009 3:26 AM by Rob_Relyea
Filed under: ,

Comments

# Dew Drop – August 21, 2009 | Alvin Ashcraft's Morning Dew@ Friday, August 21, 2009 8:24 AM

Pingback from  Dew Drop – August 21, 2009 | Alvin Ashcraft's Morning Dew

# re: Windows Tip: set PerceivedType for .xaml to “text” to get nice preview in explorer@ Friday, August 21, 2009 9:32 AM

Hi Rob,

Any way to get syntax highlighting for the XAML/cs files?

Cheers.

# re: Windows Tip: set PerceivedType for .xaml to “text” to get nice preview in explorer@ Friday, August 21, 2009 4:50 PM

Great tip!  Thanks for sharing it, Rob.

Josh

# re: Windows Tip: set PerceivedType for .xaml to “text” to get nice preview in explorer@ Friday, August 21, 2009 6:10 PM

Brad-

Good request.  I imagine that a syntax highlighting previewer could be built and installed.  Anybody could do that.  Would be great if a VS install some day would include those.  (will forward the request.)

Thanks, Rob

Josh-

My pleasure. (It also makes it easier for me to find my own tip in the future...)

Thanks, Rob

# re: Windows Tip: set PerceivedType for .xaml to “text” to get nice preview in explorer@ Friday, August 21, 2009 6:27 PM

Rob, would even be nicer if the Explorer shell was an WPF ap with an WPF based rich text editor for preview.

Since WPF can easily handle text(sic once the font display issue is resolved), Video, etc.  

But that is just one man's dream:) of course the same with MEF and explorer would become amazingly interesting.  

by Douglash

# re: Windows Tip: set PerceivedType for .xaml to “text” to get nice preview in explorer@ Saturday, August 22, 2009 6:57 AM

Very nice tip!

Leave a Comment

(required) 
(required) 
(optional)
(required)