This is to help preventing "event looping" in complicated GUI designs in which multiple controls can update the viewport and indirectly update each others.
For example, suppose in a scrollable chart design, the x-axis can be scrolled by both a scroll bar control and a date/time picker control. That means both scroll bar and date/time picker events may update the viewport.
The following sequence of events may happen:
- User changes the start date on the x-axis using the date/time picker control.
- The viewport is updated, so ChartViewer.updateViewPort is called, triggering a ChartViewer.ViewPortChanged event.
- In the ViewPortChanged event handler, the scroll bar position needs to be updated to reflect that the viewport has moved.
- As the scroll bar has changed, a scroll bar event occurs. The scroll bar event handler may update the viewport and call ChartViewer.updateViewPort again.
Internally, ChartViewer.updateViewPort use this property to checks if it is called within a ViewPortChanged event, and ignores the request if it is already in the event. This property allows external code to also change behaviour in a ViewPortChanged event.