[WPF] Window close event fixes