What is the proper way to CTRL+Z a movement?
#1
Hi,

What is the proper way to CTRL+Z a movement on the zoom panel?

Is there some stack in which all zoom panel actions are being registered so we could programmatically go back to the last place?

If there isn't such build in stack - how we can programmatically move back the zoom panel to the last place the user was in (whether it is zooming or panning)?

Thanks!

Assaf.
#2
Yes, ZoomPanel has great support for going to previous zoom location.

To enable that you need to set the IsHistoryEnabled property on ZoomPanel to true. After that ZoomPanel will collect history of all locations. You can check the locations with HistoryItems property and go back and forth with MoveBack and MoveNext methods on HistoryItems property.

See the "History" sample (ZoomPanel/ZoomPanelHistory.xaml.cs) for a sample of history usage.
Andrej Benedik
#3
Thank you for your answer!

I checked this History feature and found a bug in it:
When you move only one move and then try to go back - the back option is not enabled.
Only when you move two moves (or above) - then you can go back one or two moves.

This bug can be shown even in the History example you talked about.

I solved this issue by handling my own stack for going back in the history rather using the build-in ZoomPanel history feature.

Thanks anyway :-)

Assaf.
  


Forum Jump:


Users browsing this thread:
1 Guest(s)