public void CreateNewTab(int auditLogId) { var auditRecord = _auditLogRepository.GetDdlAudit(auditLogId).SingleOrDefault(); if (auditRecord != null) { Tabs.Add(new TabItem { Header = auditRecord.ObjectName, Content = "Edited By: " + auditRecord.Login + "\n\n" + auditRecord.Tsql }); SelectedTabIndex = Tabs.Count() - 1; } }