mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 01:11:52 +08:00
32 lines
676 B
C#
32 lines
676 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace AntDesign
|
|
{
|
|
public class ImageService
|
|
{
|
|
public event Action<ImageRef> ImagePreviewOpened;
|
|
|
|
public event Action<ImageRef> ImagePreviewClosed;
|
|
|
|
public ImageRef OpenImages(IList<Image> images)
|
|
{
|
|
if (images?.Any() != true)
|
|
return null;
|
|
|
|
var imageRef = new ImageRef(images, this);
|
|
|
|
ImagePreviewOpened?.Invoke(imageRef);
|
|
|
|
return imageRef;
|
|
}
|
|
|
|
public void CloseImage(ImageRef iamgeRef)
|
|
{
|
|
ImagePreviewClosed?.Invoke(iamgeRef);
|
|
}
|
|
}
|
|
}
|