How To Customize The DocumentViewer


The following tutorial demonstrates how to customize the various settings of the DocumentViewer.

1) Create a document viewer as is explained in the tutorial How To Use The DocumentViewer.

2) Run the application, select the screen that contains the document viewer and select a document from disk. Your applications should look like this;

ScreenShot.png

By default the document viewer renders a number of buttons that are used to zoom a document in and out.

3) Select the Design Screen button in the top-right corner of the application window to open the LightSwitch screen designer.

DesignScreenButton.png

4) Select the Document data item that is visually represented by the DocumentViewer.

5) The Properties pane reveals a number of DocumentViewer specific properties. The properties define how the DocumentViewer is rendered and what functionality is available. You can for example enable document printing which will display a print button in the command bar of the DocumentViewer.

Set the Label Position to None and check the Enable thumbnails checkbox. The changes are immediately reflected in the screen designer.

ScreenDesignerProperties.png

6) Click Save to apply the changes and return to the application. Your application should look similar to the screenshot.

UpdatedScreenShot.png

The DocumentViewer contains a set of properties that define the behavior of the control. The properties can be changed on runtime in the screen designer or in the Visual Studio designer.

Next step: learn how to store documents in a database in How To Create And Use A Table of Documents

Last edited Jul 10, 2011 at 4:01 PM by kozw, version 5

Comments

No comments yet.