Preview Tool

The Preview Tool is a Windows Media Center application that allows you to load MCML files and run them. This tool can also be used for certain types of debugging (such as syntax checking, focus and input checking, and UI region boundary indications). This tool is only supported on a computer running Windows Media Center.

The Preview Tool is registered as a Windows Media Center application, so you can run it within Windows Media Center (on the Windows Media Center Start page, go to Extras > Extras Library, and then select Preview Tool).

You can also run the Preview Tool as a stand-alone application. The stand-alone version is useful for testing UI, but it cannot run code that depends on other Windows Media Center features or APIs. For example, you cannot view live TV from the stand-alone Preview Tool.

The Preview Tool

For more information about using the Preview Tool, see Using the Preview Tool to Develop UI.

Command-Line Parameters

The stand-alone file (McmlPad.exe) is located in the \Windows\ehome folder and can be run at the command line with the following parameters. All parameters must begin with a forward slash (/) or a dash (-).

Parameter Description
/animations:false This parameter starts the Preview Tool with animations disabled.
/animations:true This parameter starts the Preview Tool with animations enabled.
/direction:ltr This parameter starts the Preview Tool in left-to-right (LTR) display mode.
/direction:rtl This parameter starts the Preview Tool in right-to-left (RTL) display mode.
/dx9 This parameter starts the Preview Tool in DirectX graphics mode. The DirectX graphics mode simulates rendering markup in a full-fidelity graphics environment that is typically used when Windows Media Center is rendered on the Media Center PC or on an Extender device such as an Xbox 360.
/folder:folder_path This parameter specifies a folder to watch for resource changes. The Preview Tool automatically refreshes as changes occur, or at a set interval if one was specified using the /interval parameter.
/gdi This parameter starts the Preview Tool in Graphics Device Interface (GDI) graphics mode. The GDI graphics mode simulates rendering markup in a low-fidelity graphics environment that does not support DirectX graphics mode.
/interval:seconds This parameter specifies the interval, in seconds, at which to refresh the Preview Tool when changes occur to resources in a specified folder (if the /folder parameter was used).
  • When set to a value less than or equal to zero, refreshes are performed in real time.
  • When set to a value greater than zero, refreshes are performed at the specified interval.
/load:file://mcml_file This parameter starts the Preview Tool and attempts to navigate to the specified uniform resource identifier (URI). You can use this as a startup command in a debugging environment to more easily debug markup. Supported URIs for this parameter include file://, http://, res://, and resx://.
/position:xxxx,yyyy This parameter starts the Preview Tool at the specified window location.
/size:xxxx,yyyy This parameter starts the Preview Tool with the specified window size to test rendering markup at various display resolutions, and to simulate aspect ratios such as 4 x 3 and 16 x 9.
-assemblyredirect:full_path This switch specifies a local directory from which to load an assembly for debugging purposes. The Preview Tool searches this local directory before searching the Global Assembly Cache (GAC) and \windows\ehome.

For example:

-assemblyredirect:c:\directory

Notes   Only one directory can be passed in, and it must not contain a trailing backslash.

This switch does not work if the assembly is also installed into the GAC. The .NET Framework always loads the assembly from the GAC when possible.

-markupredirect:before_string,after_string,suffix_to_append_to_the_end This switch specifies a local directory from which to load resources for debugging purposes. The Preview Tool replaces all instances of before_string in res:// and resx:// resource strings in markup files with after_string, then appends the resource identifier, then appends the suffix_to_append_to_the_end.

suffix_to_append_to_the_end is optional.

Examples:

-markupredirect:resx://Sampler/,file://c:\directory\,.mcml

Causes the following replacements:

xmlns:spin="resx://Sampler/Scenarios.SimpleSpinner"

becomes

xmlns:spin="file://c:\directory\Scenarios.SimpleSpinner.mcml"

-markupredirect:res://Sampler/,file://c:\directory\

Causes the following replacement:

xmlns:spin="res://Sampler/Scenarios.SimpleSpinner.mcml"

becomes

xmlns:spin="file://c:\directory\Scenarios.SimpleSpinner.mcml"

You can specify multiple groups of before_string,after_string,suffix_to_append_to_the_end by separating each group by semicolons.

See Also