This sample shows how to implement pan and zoom in a diagram programmatically. Drag the diagram while holding the Ctrl key and it will pan. Scroll the mouse wheel and the diagram will zoom.