TAdvOfficePager Undock - Close button to redock?

Using 10.4.1

I have an TAdvOfficePager that allows undocking now.

I have the following events to set the onClose event of the floating window.

Problem here is I don't know what to do to pickup during the onClose event of
the floating window to send the tab control inside it BACK to the TAdvOfficePager.

I might be able to scan through the controls on the floating form to find the tab?
but I don't think that would be proper way.

Basically, I just want the undocked tabs floating form, when user closes it, to re-dock it.

procedure TfrmDesigner.TabsGadgetTabUnDock(Sender: TObject; APage: TAdvOfficePage);
APage.GetFloatingWindow.Caption := APage.Caption;
APage.GetFloatingWindow.OnClose := FloatingFormClose;

procedure TfrmDesigner.FloatingFormClose(Sender: TObject; var Action: TCloseAction);
fPage: TFloatingPagerWindow;
if Sender is TFloatingPagerWindow then
fPage := (Sender as TFloatingPagerWindow);

You should be able to write something like:

procedure TForm1.FloatingFormClose(Sender: TObject; var Action: TCloseAction);
  ((Sender as TFloatingPagerWindow).Controls[0] as TAdvOfficePager).AdvPages[0].Parent  := AdvOfficePager1;

Ok thanks that works. Along the lines of what I thought would need to do in the end but wondered if I was missing something to "easily" add it back... Thanks again.