Thinking about it in the context of violence makes the matter much more confusing. Should they tell right away so the person won't be angry? But then they're revealing very personal information to someone they don't know well. Or do they wait? But then a person who would get angry will probably be even angrier because the information was withheld for so long.
Considering the prospect of dating a trans woman doesn't bother me, I can't really look at this situation and give one straight answer.
One the one hand, I do feel like I would want to know it right away. But on the other hand, it doesn't really bother me at all so why should they feel obligated to tell me? She would have no idea how I'd react.
EDIT: If she still had a penis and testes I would definitely want to know before we had sex, because regardless of my acceptance, that's a pretty big surprise. If she's had the surgery then she should tell when she's comfortable.