I have an winforms application developed inside SpotFire. I have registered the view as below.
registrar.Register(typeof(Control), typeof(CustomVisual), typeof(WinformUI));
But when I switch between pages inside SpotFire client, whole of winforms screen gets refreshed and redrawn.
This causes error. How do we retain the view state in winforms UI.
Default behaviour of SpotFire visualization Add-On and other Visualization tools is it will be re-drawn and refresh on page switch.
In this case we have developed a visualization in c# winforms, on page switch SpotFire disposes all the resources related to Add-On which caused error on redraw/refresh on returning to application after page switch.
To retain the state and to avoid errors we implemented SpotFire properties such as Document Nodes, Undoable nodes instead of normal property classes to retain the state on page switch. Below link explains how to implement/extend the SpotFire Documents.