I've been on both sides I think.
As the aggrieved party (cheating, assault, rape), after three years being invited to a mutual friend's party. I said I would love to come but couldn't be in his company (mutual friend didn't know extent of problems but did know some) so I'd bow out if he was going. He wasn't invited; I had a great time; all was well. But even though it was so much later and I was happily with someone else, I simply couldn't have spent an hour entire evening in his company.
I'm not clear how the OP's contact with her XH works, but the development that he had then asked her not to go at all did not surprise me. IMHO it is for him to withdraw, but I understand his hurt.
On the other hand, as the dumper, again three years later, I went to my best friend's wedding, with DH. We had met within weeks of the previous breakup, were engaged within weeks and married at the first reasonable opportunity - although there was definitively no overlap I can see that it would have looked like undue haste to my apparently heartbroken ex, who had been ready to propose when I ended it.
I played a role in the wedding ceremony, so it wasn't like he could ignore my presence. He was still single; I was married to a man about as different from him as possible.
It was all fine and we exchanged civil words but it must have been hard. He got very drunk.
I think the ex's feelings are understandable, but his demands are unreasonable. I think the OP has to be the bigger person in this instance, annoying though that is. Two years is no time really - I'm still not over the bad ex from over a decade ago.