private async Task AddTabAsync(XTab tab) { _tabContent.Add(tab); if (_tabContent.Count == 1 || NewTabSetActive) { await SetActiveAsync(tab); } if (OnTabAdded.HasDelegate) { await OnTabAdded.InvokeAsync(tab); } }
public async Task AddPageAsync(XTab tab) { ///TODO: Using Titles for now. Probably should use an ID. if (RenderMode == RenderMode.Full && _tabContent.FirstOrDefault(x => x.Title == tab.Title) is XTab existingTab) { await SetActiveAsync(existingTab); } else { _tabContent.Add(tab); if (_tabContent.Count == 1 || NewTabSetActive) { await SetActiveAsync(tab); } if (OnTabAdded.HasDelegate) { await OnTabAdded.InvokeAsync(tab); } } await NotifyStateHasChangedAsync(); }