public void QueryScriptCreateCommandHandler(object sender, ExecutedRoutedEventArgs e) { e.Handled = true; object dbo = this.ActiveDBObject(); if (dbo != null) { QueryDocument qd = GetQueryEditor(); qd.ScriptCreate((SchemaObjectBase)dbo); } }