Fire attach/detach events when Window is added/removed from UI (#14908).

Change-Id: Idc51aa5ab97a9d3f7a1f316d9536ae1cbaeafe38