big refactoring. get rid of static properties and coupled architecture. prepare system for integration tests

This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-11-17 13:14:05 +02:00
parent 22529c26ec
commit e7ea5a8ded
38 changed files with 808 additions and 157 deletions
+7 -3
View File
@@ -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 &&