Managing application resources when WPF is hosted