Skip to content

Latest commit

 

History

History
43 lines (37 loc) · 1.01 KB

kb-diagram-howto-zoom-in-selection.md

File metadata and controls

43 lines (37 loc) · 1.01 KB
title page_title description type slug position tags ticketid res_type
How to Center the Zoom on the Selected Items
Zoom in the region of the Selected Shapes
How to Center the Zoom on the Selection.
how-to
kb-diagram-howto-zoom-in-selection
0
center, zoom, selection
1448223
kb

Environment

Product Version 2019.3.1023
Product RadDiagram for WPF

Description

How to force the zoom operation inside the selection boundaries.

Solution

Handle the PreviewZoom event of the RadDiagram and use its BringIntoView method in conjunction with its Zoom property.

[C#]

{{region kb-diagram-howto-zoom-in-selection-0}} private void diagram_PreviewZoom(object sender, Telerik.Windows.Controls.Diagrams.DiagramZoomEventArgs e) { e.Handled = true; this.diagram.BringIntoView(diagram.SelectionBounds, false); this.diagram.Zoom = e.TargetZoom; } {{endregion}}