ikeough/Dynamo — pull request #741 by Benglin (2013-11-14 05:33:03+00:00)
Title: Fix: MAGN-711 Connector and Info Bubble alignment issues

Background
==========
The [original fix](https://github.com/ikeough/Dynamo/pull/727) that was meant to fix [a crash reported by our user](https://github.com/ikeough/Dynamo/issues/725) has caused this problem instead. The new problem was caused by **dynNodeView.ViewModel** not being set at the time **dynNodeView.OnSizeChanged** was called (OnSizeChange requires ViewModel to properly compute a node's dimension).

Here are the sequence of event:

* dynNodeView constructor
* dynNodeView.OnDataContextChanged
* dynNodeView.OnSizeChanged // ViewModel is needed here!
* dynNodeView.OnNodeViewLoaded // ViewModel is set here...

Note that the required **dynNodeView.ViewModel** property is only set in **OnNodeViewLoaded**, but it was needed in **OnSizeChanged**. Obviously that was a little too late. The best way (the fix) turns out to be that **NodeViewModel** is ready in **OnDataContextChanged**, and **dynNodeView.ViewModel** can be updated to the right value in **OnDataContextChanged**.