How to make the Steam overlay work with WPF?

I have developed a game using C#+WPF and the game is currently on Steam (private branch until release). However Steam's overlay isn't working with WPF. Sometimes it tries to appear in the popups of