The Princess of Wales attended major ceremonies for the first time since announcing the end of her cancer treatments.