In WinRT, the ScrollViewer is a convenient control that supports Zoom/Pan features for its content in default. But I got stuck on controlling the Zoom/Pan features of the ScrollViewer’s content in code-behind(c-sharp file). If I know how ScrollViewer works, the problem should be solved as expected.
Note: I’ve tried to write the event-handling method to listen to ScrollViewer’s ManipulationXXX event, but it hadn’t been run into. Only I can listen to ScrollViewer’s ViewChanged event.
I can get ScrollViewer object’s
ZoomFactorproperty which tells you the current zoom value. If you want to change the zoom value of the content, just useZoomToFactor(float factor).