VE-538: move dialog open/close tracking to Dialog class.