Save/Load InGame panel position/size

This is a UI/UX issue I’m not sure how to do, hoping someone may know.

I want to save a toolbar app window position/size on close (disconnectedcallback I guess?) and load them on panel open (connectedcallback I guess?) for a better UX. This is so a user can size and position it for regular use according to their own preference and it will always load the last used size/position. Alternatively, there could also be some settings that can be saved to default values to override the last used ones.

I know you can set them in the initial packagesources/InGamePanels/toolbarapp.xml (see below for an example) but unclear how to get/set this at runtime reliably.

Any clues?

Example toolbar app initial setup xm;:

<?xml version="1.0" encoding="utf-8"?>

<SimBase.Document Type=“InGamePanels” version=“1.0”>
InGamePanel_GenericToolbarApp.spb
<InGamePanels.InGamePanelDefinition
id=“PANEL_GENERIC_TOOLBAR_APP”
Name=“Generic Toolbar App”
url=“html_ui/ingamePanels/GenericToolbarApp/GTAPanel.html”
resizeDirections=“Both”
minWidth=“33”
minHeight=“36”
defaultWidth=“36”
defaultHeight=“36”
defaultTop=“33”
defaultRight=“2”
icon=“ICON_GENERIC_TOOLBAR_APP”
buttonVisible=“true”

</InGamePanels.InGamePanel_ControlsIndicator>
</SimBase.Document>