Hi there,
You have had excellent advice ! I can't blame your little dog for reacting the the he did though. He needs to be taught not to growl and show threatning behaviors around young children. However, there is a mutual respect that needs to happen. It is not all one sided. The younger the child is, the more a parent needs to take the responibility for the child's behavior. There is no way a 2-3 yr old young child's behavior is to be blamed for playing with a ball in a pool. If it was the dog's ball, then the ball needs to be put away. Of course this is going to be seen as a threat to the dog. Dogs, are, IMO, just like a toddler.
With the propper training your Yorkie will be able to relax and feel comforable chikldren, howeverm, I advise you and ALL grown ups to be very cautious when there are very young preschool aged children near any dogs, especially toy breed dogs. I do not think it is right to Crate your Yorkie when the kids are around, with propper supervision, and training , respect by all , kids and Dog , then all should be happy