private void AddMainUnit(int id) { if (!LibraryData.SystemIsOpen) { LibraryData.CreateEmptySystem(); } var esc = LibraryData.AddEsc(id); if (esc == null) { return; } var escview = new MainUnitViewModel(esc, this); if (!TabCollection.Contains(escview)) { TabCollection.Add(escview); } }