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);
begin
APage.GetFloatingWindow.Caption := APage.Caption;
APage.GetFloatingWindow.OnClose := FloatingFormClose;
end;

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

You should be able to write something like:

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

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.