Undo / redo on custom buttons

Hello,
I am trying to do undo / redo annotations from my custom buttons (outside from viewer).
I have already seen AnnotationHistoryManager class but i am unable to achieve it.
I am using " this.viewerInstance.CoreControls.AnnotationHistoryManager.undo() " to undo the changes.
Can anyone please tell me , is it possible to do undo redo from custom buttons? if yes please provide some detailed example , how can i use these methods from AnnotationHistoryManager.

Thank you,
Vivek Sonawane

Hey there,

I actually just answered this question here!

If you have any more questions, let me know in that thread.

Thanks,
Logan