private int Activate(int index, string transition = " transition: -webkit-transform 500ms ease 0s;") { if (Effect == CarouselEffect.ScrollX) { _trackStyle = $"width: {_totalWidth}px; opacity: 1; transform: translate3d(-{_slickWidth * (index + 1)}px, 0px, 0px);{transition}"; } if (index == _slicks.Count) { index = 0; } CarouselSlick slick = _slicks[index]; _slicks.ForEach(s => { if (s == slick) { _activeSlick = s; s.Activate(); } else { s.Deactivate(); } }); return(index); }
internal void AddSlick(CarouselSlick slick) { _slicks.Add(slick); if (_activeSlick == null) { Activate(0); } }
internal void RemoveSlick(CarouselSlick slick) { var slicks = new List <CarouselSlick>(_slicks ?? new List <CarouselSlick>()); slicks.Remove(slick); _slicks = slicks; InvokeAsync(async() => { await InvokeAsync(StateHasChanged).ConfigureAwait(false); }); }
internal void AddSlick(CarouselSlick slick) { var slicks = new List <CarouselSlick>(_slicks ?? new List <CarouselSlick>()); slicks.Add(slick); _slicks = slicks; if (ActiveSlick == null) { Activate(_slicks[0]); } InvokeStateHasChanged(); }
private void Activate(CarouselSlick slick) { this.ActiveSlick = slick; }
internal int IndexOfSlick(CarouselSlick slick) { return(_slicks.IndexOf(slick)); }
internal void RemoveSlick(CarouselSlick slick) { _slicks.Remove(slick); }