Benefits of using ViewLink

The two samples below demonstrate a Calendar HTC component implemented using two variations of Element Behaviors. The first page implements a regular Element Behavior and the second implements an Element Behavior with a ViewLink. The samples show how a ViewLink encapsulates document content and permits greater control over CSS Style inheritance.

Control: Clicking the button below will apply a new stylesheet rule to all of the <TD> elements on page 1 and 2. Notice that the <TD> elements in the Element Behavior sample are changed, but the ViewLink elements stay the same.
Encapsulation: Clicking on the buttons in each of the pages above builds a page that displays the document tree. Notice that the primary document tree with the ViewLink is dramatically less complex than the Element behavior tree, this is because the document content in the ViewLink component is encapsulated in the component HTC document.

©Microsoft Corporation. All rights reserved. Terms of use.
Page 1 - Calendar using Element Behavior
Page 2 - Calendar using ViewLink