reuse VirtualizingWrapPanel for display Dataset Explorer

This commit is contained in:
Alex Bezdieniezhnykh
2024-09-04 20:02:55 +03:00
parent 9436e96d81
commit b4bedb7520
7 changed files with 186 additions and 69 deletions
+14 -2
View File
@@ -27,6 +27,7 @@ public partial class MainWindow
private readonly IConfigRepository _configRepository;
private readonly HelpWindow _helpWindow;
private readonly ILogger<MainWindow> _logger;
private readonly IGalleryManager _galleryManager;
private CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
public ObservableCollection<AnnotationClass> AnnotationClasses { get; set; } = new();
@@ -48,7 +49,8 @@ public partial class MainWindow
IConfigRepository configRepository,
HelpWindow helpWindow,
DatasetExplorer datasetExplorer,
ILogger<MainWindow> logger)
ILogger<MainWindow> logger,
IGalleryManager galleryManager)
{
InitializeComponent();
_libVLC = libVLC;
@@ -60,6 +62,7 @@ public partial class MainWindow
_helpWindow = helpWindow;
_datasetExplorer = datasetExplorer;
_logger = logger;
_galleryManager = galleryManager;
VideoView.Loaded += VideoView_Loaded;
Closed += OnFormClosed;
@@ -70,6 +73,15 @@ public partial class MainWindow
Core.Initialize();
InitControls();
_ = Task.Run(async () =>
{
while (true)
{
await _galleryManager.RefreshThumbnails();
await Task.Delay(30000);
}
});
_suspendLayout = true;
Left = _config.WindowLocation.X;
@@ -222,7 +234,7 @@ public partial class MainWindow
var name = Path.GetFileNameWithoutExtension(file.Name);
var time = _formState.GetTime(name)!.Value;
await AddAnnotation(time, await YoloLabel.ReadFromFile(file.FullName, cancellationToken));
await AddAnnotation(time, await YoloLabel.ReadFromFile(file.FullName));
}
}