The referenced princess was Margaret of Denmark (or Margrethe I in Danish). She was the wife of King Haakon VI of Norway in a political marriage arranged by her father, Valdemar IV of Denmark; she was 10 at the time of her wedding in 1363. At the time, Norway and Sweden were joined in a personal union, which was challenged by the Swedes and resulted in Haaken VI being deposed as ruler of Sweden in 1364, right around the same time that her older brother died, leaving her as Valdemar IV's sole heir. In 1370, at 17, she gave birth to a son with Haaken, Olaf. But everything really started when her father died in 1375, and she and Haaken managed to secure the Danish succession for Olaf (now Olaf II).
Then Haaken died in 1380, and the 10-year-old Olaf succeeded him as king of Norway as well, with Margaret as regent. But then Olaf died in 1387, and Margaret, as regent, not only became de facto ruler of both Denmark and Norway, but she also gathered an army and organized an offensive to retake Sweden, which succeeded in 1388 (although the Hanseatic League didn't surrender Stockholm to Margaret until 1398). Because the Norwegians wanted a king, she ended up appointing her 8-year-old great-nephew Eric of Pomerania (her sister's grandson) as her successor in 1389, while she continued as regent, and Eric also became king of Denmark and Sweden (with Margaret as regent) in 1396, a union that was sealed with a triple crowning ceremony for Eric in 1397.
But neither that nor Eric's marriage to Philippa of England in 1406 (which Margaret arranged) interfered with her continuing rule until her death in 1412. So she was the ruler of Denmark and Norway from 1380 to 1412 (32 years) and of Sweden from 1388 or 1398 until 1412 (either 24 or 14 years). Although she was never crowned, she managed to avoid the palace intrigue that surrounded most other female rulers at that time while ruling three formerly-rebellious countries, which says a lot for her diplomatic skills.
https://en.wikipedia.org/wiki/Margaret_I_of_Denmark