protected virtual async Task SetupSvgImg() { if (Component != null) { return; } string svgClass = Spin ? "anticon-spin" : null; if (!string.IsNullOrEmpty(IconFont)) { var svg = $"<svg><use xlink:href=#{IconFont} /></svg>"; _svgImg = IconService.GetStyledSvg(svg, svgClass, Width, Height, Fill, Rotate); StateHasChanged(); } else { await Task.Run(async() => { var svg = await IconService.GetIconImg(Type.ToLowerInvariant(), Theme.ToLowerInvariant()); _svgImg = IconService.GetStyledSvg(svg, svgClass, Width, Height, Fill, Rotate); await InvokeAsync(StateHasChanged); }); } }
protected override Task SetupSvgImg() { var svg = $"<svg><use xlink:href=#{Type} /></svg>"; _svgImg = IconService.GetStyledSvg(svg, null, Width, Height, Fill, Rotate); StateHasChanged(); return(Task.CompletedTask); }
private async ValueTask LoadImage() { if (!IsImage) { return; } var iconType = DetermineIconType(); _svgImage = await IconService.GetIconImg(iconType.type, iconType.theme); }
private void LoadImage() { if (!IsImage) { return; } var iconType = DetermineIconType(); _svgImage = IconService.GetIconImg(iconType.type, iconType.theme); }
protected virtual async Task SetupSvgImg() { if (Component != null) { return; } if (!string.IsNullOrEmpty(IconFont)) { var svg = $"<svg><use xlink:href=#{IconFont} /></svg>"; _svgImg = IconService.GetStyledSvg(svg, Width, Height, Fill); } else { var svg = await IconService.GetIconImg(Type.ToLowerInvariant(), Theme.ToLowerInvariant()); _svgImg = IconService.GetStyledSvg(svg, Width, Height, Fill); } StateHasChanged(); }