Bind TreeView events later

Fixes crash in WPF.