Added onAttach onDetach hook to ViewImpl

If you want to throw when the widget is never initialized, you can do that in asWidget() before returning.