public bool TabExists(IMainTabItem tab) { var isEx = (from item in Tabs where item.Header.Equals(tab.Header) select item).Any(); return(isEx); }
public bool AddId(IMainTabItem tab) { var nextId = 0; if (_ids.Count == 0) { nextId = 1; } else { nextId = _ids.Values.Max() + 1; } if (!_ids.ContainsKey(tab)) { _ids.Add(tab, nextId); return(true); } return(false); }
public int GetId(IMainTabItem tab) { return((from item in _ids where item.Key.Equals(tab) select item.Value).FirstOrDefault()); }