示例#1
0
 protected override void OnAfterRender(bool firstrun)
 {
     if (IsOpen ?? false)
     {
         var placement = Placement.ToDescriptionString();
         BlazorStrapInterop.Popper(Target, Id, Arrow, placement);
     }
 }
示例#2
0
 protected override void OnAfterRender(bool firstrun)
 {
     if (Target != null)
     {
         var placement = Placement.ToDescriptionString();
         BlazorStrapInterop.Tooltip(Target, Tooltip, Arrow, placement);
     }
 }
示例#3
0
 protected override async Task OnAfterRenderAsync(bool firstrun)
 {
     if (firstrun)
     {
         await Popper.SetPopper();
     }
     if (IsOpen ?? false)
     {
         var placement = Placement.ToDescriptionString();
         await BlazorStrapInterop.Popper(Target, Id, Arrow, placement);
     }
 }
 protected override async Task OnAfterRenderAsync(bool firstrun)
 {
     if (firstrun)
     {
         await Popper.SetPopper();
     }
     if (Target != null)
     {
         var placement = Placement.ToDescriptionString();
         await BlazorStrapInterop.Tooltip(Target, Tooltip, Arrow, placement);
     }
 }
示例#5
0
        internal override async Task Changed(bool e)
        {
            if (!_isInitialized)
            {
                return;
            }

            BSModalEvent = new BSModalEvent()
            {
                Target = this
            };
            if (e)
            {
                await BlazorStrapInterop.AddBodyClass("modal-open");

                if (!IgnoreEscape)
                {
                    await BlazorStrapInterop.ModalEscapeKey(this);
                }
                new Task(async() =>
                {
                    _toggleModel = true;
                    await InvokeAsync(StateHasChanged).ConfigureAwait(false);
                    await Task.Delay(300).ConfigureAwait(false);
                    _toggleShow = e;
                    await InvokeAsync(StateHasChanged).ConfigureAwait(false);
                }).Start();
                await ShowEvent.InvokeAsync(BSModalEvent).ConfigureAwait(false);
            }
            else
            {
                new Task(async() =>
                {
                    _toggleShow = e;
                    await InvokeAsync(StateHasChanged).ConfigureAwait(false);
                    await Task.Delay(300).ConfigureAwait(false);
                    _toggleModel = false;
                    await InvokeAsync(StateHasChanged).ConfigureAwait(false);
                }).Start();
                await HideEvent.InvokeAsync(BSModalEvent).ConfigureAwait(false);

                await BlazorStrapInterop.RemoveBodyClass("modal-open");
            }
        }
示例#6
0
        private async Task OnActiveIndexChanged()
        {
            foreach (BSCarouselItemBase item in Parent.CarouselItems)
            {
                await new BlazorStrapInterop(JSRuntime).RemoveClass(item.MyRef, "carousel-item-left carousel-item-right carousel-item-prev carousel-item-next");
            }

            if (Parent.CarouselItems[Parent.ActiveIndex] == this)
            {
                Parent.AnimationRunning = true;
                Console.WriteLine(MyRef.Id + "-Start - " + Parent.ActiveIndex.ToString(CultureInfo.InvariantCulture));
                var js = new BlazorStrapInterop(JSRuntime);
                if (Parent.Direction == 0)
                {
                    var oldindex = Parent.ActiveIndex == 0 ? Parent.NumberOfItems - 1 : Parent.ActiveIndex - 1;

                    if (await js.AddClass(MyRef, "carousel-item-next"))
                    {
                        new Task(async() =>
                        {
                            await Task.Delay(100).ConfigureAwait(false);
                            await js.AddClass2Elements(MyRef, Parent.CarouselItems[oldindex].MyRef, "carousel-item-left");
                        }).Start();
                    }
                }
                else if (Parent.Direction == 1)
                {
                    var oldindex = Parent.ActiveIndex + 1;
                    if (Parent.ActiveIndex == Parent.NumberOfItems - 1)
                    {
                        oldindex = 0;
                    }
                    if (await js.AddClass(MyRef, "carousel-item-prev"))
                    {
                        new Task(async() =>
                        {
                            await Task.Delay(100).ConfigureAwait(false);
                            await js.AddClass2Elements(MyRef, Parent.CarouselItems[oldindex].MyRef, "carousel-item-right");
                        }).Start();
                    }
                }
            }
        }
示例#7
0
 public BlazorStrapCore(BlazorStrapInterop interop)
 {
     Interop = interop;
 }