Added viewcontext when create dialog

Added viewcontext when create dialog