There are times when I want to preview file content in Windows Explorer. The Preview pane in Explorer makes this a simple task. Just click the Preview pane button and select the file as shown in Figure 1 and Figure 2.
Figure 1: The preview pane button.
Figure 2: Viewing a .txt file.
In this example I am previewing a .txt file. Use the Ctrl + mouse wheel to change the zoom level on the text. Also, ALT+P toggles the preview pane.
Adding your own extensions
Making a simple registry edit allows you to see other files, like .csproj and .xaml, in the preview pane.
Here’s how I did the XAML extension (see Figure 3).
- Open the HKEY_CLASSES_ROOT\.xaml key in Regedit.
- Add a string key named PerceivedType.
- Set the value of the PerceivedType key to ‘text’.
Figure 3: Adding a registry key.
Now you can preview the content.
Figure 4: Viewing the .xaml file