示例#1
0
        private async Task AcitveTabOnRenderCompletedAsync()
        {
            if (IsActive && TabContainer.Type == TabType.Normal)
            {
                if (string.IsNullOrWhiteSpace(Element.Id))
                {
                    return;
                }
                Console.WriteLine("id:" + Element.Id);
                var dom   = Element.Dom(JSRuntime);
                var width = await dom.GetClientWidthAsync();

                var paddingLeft = await dom.Style.GetPaddingLeftAsync();

                var offsetLeft = await dom.GetOffsetLeftAsync();

                var padding       = paddingLeft + (await dom.Style.GetPaddingRightAsync());
                var barWidth      = width - padding;
                var barOffsetLeft = offsetLeft + paddingLeft;
                if (barWidth < 0)
                {
                    Refresh();
                    return;
                }
                await TabContainer.UpdateHeaderSizeAsync(this, barWidth, barOffsetLeft);
            }
            else
            {
                await TabContainer.TabRenderCompletedAsync(this);
            }
        }
示例#2
0
        private async Task AcitveTabOnRenderCompletedAsync()
        {
            if (IsActive && TabContainer.Type == TabType.Normal)
            {
                var dom   = Element.Dom(JSRuntime);
                var width = await dom.GetClientWidthAsync();

                var paddingLeft = await dom.Style.GetPaddingLeftAsync();

                var offsetLeft = await dom.GetOffsetLeftAsync();

                var padding       = paddingLeft + (await dom.Style.GetPaddingRightAsync());
                var barWidth      = width - padding;
                var barOffsetLeft = offsetLeft + paddingLeft;
                await TabContainer.UpdateHeaderSizeAsync(this, barWidth, barOffsetLeft);
            }
            else
            {
                await TabContainer.TabRenderCompletedAsync(this);
            }
        }