Exemplo n.º 1
0
        /// <summary>
        /// 设置指定 TabItem 为激活状态
        /// </summary>
        /// <param name="item"></param>
        public void ActiveTab(TabItem item)
        {
            _items.ForEach(i => i.SetActive(false));
            item.SetActive(true);

            StateHasChanged();
        }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
 /// <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);
     }
 }
Exemplo n.º 5
0
 /// <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);
     }
 }
Exemplo n.º 6
0
        /// <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();
        }
Exemplo n.º 7
0
        /// <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);
        }
Exemplo n.º 8
0
        /// <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);
        }
Exemplo n.º 9
0
 private void ActiveTabItem(TabItem item)
 {
     _items.ForEach(i => i.SetActive(false));
     item.SetActive(true);
 }