mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:06:31 +00:00
big refactoring. get rid of static properties and coupled architecture. prepare system for integration tests
This commit is contained in:
@@ -7,10 +7,12 @@ using Azaion.Common.Extensions;
|
||||
|
||||
namespace Azaion.Common.DTO;
|
||||
|
||||
public class AnnotationThumbnail(Annotation annotation, bool isValidator) : INotifyPropertyChanged
|
||||
public class AnnotationThumbnail(Annotation annotation, bool isValidator, string imagePath, string thumbPath) : INotifyPropertyChanged
|
||||
{
|
||||
public Annotation Annotation { get; set; } = annotation;
|
||||
public bool IsValidator { get; set; } = isValidator;
|
||||
private readonly string _imagePath = imagePath;
|
||||
private readonly string _thumbPath = thumbPath;
|
||||
|
||||
private BitmapImage? _thumbnail;
|
||||
public BitmapImage? Thumbnail
|
||||
@@ -18,7 +20,9 @@ public class AnnotationThumbnail(Annotation annotation, bool isValidator) : INot
|
||||
get
|
||||
{
|
||||
if (_thumbnail == null)
|
||||
Task.Run(async () => Thumbnail = await Annotation.ThumbPath.OpenImage());
|
||||
{
|
||||
Task.Run(async () => Thumbnail = await _thumbPath.OpenImage());
|
||||
}
|
||||
return _thumbnail;
|
||||
}
|
||||
private set
|
||||
@@ -28,7 +32,7 @@ public class AnnotationThumbnail(Annotation annotation, bool isValidator) : INot
|
||||
}
|
||||
}
|
||||
|
||||
public string ImageName => Path.GetFileName(Annotation.ImagePath);
|
||||
public string ImageName => Path.GetFileName(_imagePath);
|
||||
public string CreatedDate => $"{Annotation.CreatedDate:dd.MM.yyyy HH:mm:ss}";
|
||||
public string CreatedEmail => Annotation.CreatedEmail;
|
||||
public bool IsSeed => IsValidator &&
|
||||
|
||||
Reference in New Issue
Block a user