4 Answers, 1 is accepted
You can zoom programmatically with the Zoom property of PanAndZoomImage. Just make sure that ZoomMode is set to Free.
If you have more questions, please write again.
Victor
Telerik
PanAndZoomImage currentPanAndZoomImage = ElementTreeHelper.FindVisualDescendant<PanAndZoomImage>(this.slideView.SelectedItemContainer);
currentPanAndZoomImage.ZoomMode = ImageZoomMode.Free;
currentPanAndZoomImage.Zoom =2;
it throw this exception
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Thanks for writing again.
Since the PanAndZoomImage is inside a DataTemplate in this case, you do not have direct access to it. In order to make it zoom on orientation change you need to create a view model object, insert it inside App's resources and bind PanAndZoomImage to the Zoom property of your view model. The view model needs to implement the INotifyPropertyChanged interface and needs to update its Zoom property when the page orientation changes. Finally, the binding of the zoom property should be a TwoWay binding so that when you zoom inside your slide view, the binding does not break.
Another approach is to bind the Zoom property of your PanAndZoomImage to the Orientation property of your page. By using a binding value converter you can translate the orientation to a zoom factor.
Victor
Telerik