public void Dispose()
 {
     if (_canvas != null)
     {
         _canvas.EndDrawing();
         _canvas = null;
     }
 }
 public XamlCanvasSession(XamlCanvas canvas)
 {
     this._canvas = canvas;
     canvas.BeginDrawing();
 }