ant-design-blazor/components/image/ImagePreview.razor.cs
James Yeung c9656ca227 feat(module: image): add image component (#1038)
* feat(module: image): add image

* add image preview

* add locale
2021-01-25 02:05:18 +08:00

45 lines
852 B
C#

using Microsoft.AspNetCore.Components;
namespace AntDesign
{
public partial class ImagePreview
{
[Parameter]
public string ImageUrl { get; set; }
[Inject]
private ImageService ImageService { get; set; }
private int _zoomOutTimes = 1;
private int _rotateTimes;
private void HandleClose()
{
ImageService.CloseImage(ImageUrl);
}
private void HandleZoomIn()
{
_zoomOutTimes++;
}
private void HandleZoomOut()
{
if (_zoomOutTimes > 1)
{
_zoomOutTimes--;
}
}
private void HandleRotateRight()
{
_rotateTimes++;
}
private void HandleRotateLeft()
{
_rotateTimes--;
}
}
}