It is said that trotz historically went well with both the dative and the genitive cases, while in contemporary usage the genitive becomes the norm and the dative survives only in idiomatic ‘frozen’ expressions. My difficulty is with those special cases when the dative case is used instead of the genitive. I have no idea when the dative must be used.
It seems to me that the so-called idiomatic expressions are a bunch of combinations of pronouns and trotz, such as trotzdem, trotz allem/alledem.
Could I conclude that when trotz goes with a pronoun, the dative case should be used instead of the genitive while with a noun, the genitive should be used?
If my claim is wrong, could anyone provide some tip on when the dative case must be used instead of the genitive with trotz?