/// <summary> /// 设置指定 TabItem 为激活状态 /// </summary> /// <param name="item"></param> public void ActiveTab(TabItem item) { _items.ForEach(i => i.SetActive(false)); item.SetActive(true); StateHasChanged(); }
/// <summary> /// 设置指定 TabItem 为激活状态 /// </summary> /// <param name="item"></param> public virtual Task ActiveTab(TabItem item) { _items.ForEach(i => i.SetActive(false)); item.SetActive(true); TabHeader?.Render(); TabContent?.Render(); return(Task.CompletedTask); }
/// <summary> /// 设置指定 TabItem 为激活状态 /// </summary> /// <param name="item"></param> public virtual Task ActiveTab(TabItem item) { _items.ForEach(i => i.SetActive(false)); item.SetActive(true); StateHasChanged(); return(Task.CompletedTask); }
/// <summary> /// 点击 TabItem 时回调此方法 /// </summary> protected virtual async Task OnClickTabItem(TabItem item) { Items.ToList().ForEach(i => i.SetActive(false)); item.SetActive(true); if (OnClickTab != null) { await OnClickTab(item); } }
/// <summary> /// 点击 TabItem 时回调此方法 /// </summary> private async Task OnClickTabItem(TabItem item) { Items.ToList().ForEach(i => i.SetActive(false)); if (OnClickTab != null) { await OnClickTab(item); } if (!ClickTabToNavigation) { item.SetActive(true); } }
/// <summary> /// 添加 TabItem 方法 /// </summary> /// <param name="item"></param> public void Add(TabItem item) { var check = _items.Contains(item); if (item.IsActive || !check) { _items.ForEach(i => i.SetActive(false)); } if (!check) { _items.Add(item); item.SetActive(true); } StateHasChanged(); }
/// <summary> /// 添加 TabItem 方法 /// </summary> /// <param name="item"></param> public virtual Task Add(TabItem item) { var check = _items.Contains(item); if (item.IsActive || !check) { _items.ForEach(i => i.SetActive(false)); } if (!check) { _items.Add(item); item.SetActive(true); } StateHasChanged(); return(Task.CompletedTask); }
/// <summary> /// 添加 TabItem 方法 /// </summary> /// <param name="item"></param> public virtual Task Add(TabItem item) { var check = _items.Contains(item); if (item.IsActive || !check) { _items.ForEach(i => i.SetActive(false)); } if (!check) { _items.Add(item); item.SetActive(true); } TabHeader?.Render(); TabContent?.Render(); return(Task.CompletedTask); }
private void ActiveTabItem(TabItem item) { _items.ForEach(i => i.SetActive(false)); item.SetActive(true); }