set diagram on type provider before layout of new diagram

fixes issue where connection were being removed when switching routes in the editor.