All of the code examples I've seen on the subject access the Skia Canvas by defining a "PaintSurface" event in the XAML of a SKCanvasView and accessing the surface and the canvas via. the event handlers' passed arguments.
What I'm looking for is a way to access the SKSurface by demand and not just when the canvas is painted.
For instance - I want to have a page with a Canvas which paints something and a button, which, when pressed - will access the SKSurface and save the current painting via the "SnapShot()" method.
The problem is that I don't have access to the active SKSurface when handling the 'save' button click, since that is retreived only when the paint event is handled.
I tried holding a global SKSurface variable that is assigned the value given whenever the paint event is handeled, but that didn't work too, since the Application crashed completely when I tried calling it's Snapshot() method.
Are there any other ways of obtaining and using the active SKSurface from outside of the PaintSurface event?