Use LibationUiBase.ReactiveObject where applicable

Also tweak the classic process queue control layout
This commit is contained in:
Michael Bucari-Tovo
2025-07-22 11:59:34 -06:00
parent 0f7ffacdf8
commit 0f4197924e
9 changed files with 25 additions and 74 deletions

View File

@@ -1,5 +1,4 @@
using LibationFileManager;
using LibationUiBase;
using LibationUiBase;
using LibationUiBase.ProcessQueue;
using System;
using System.ComponentModel;
@@ -35,23 +34,18 @@ internal partial class ProcessQueueControl : UserControl
ViewModel.PropertyChanged += ProcessQueue_PropertyChanged;
ViewModel.LogEntries.CollectionChanged += LogEntries_CollectionChanged;
ProcessQueue_PropertyChanged(this, new PropertyChangedEventArgs(null));
}
private void LogEntries_CollectionChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (!IsDisposed && e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
{
foreach(var entry in e.NewItems?.OfType<LogEntry>() ?? [])
foreach (var entry in e.NewItems?.OfType<LogEntry>() ?? [])
logDGV.Rows.Add(entry.LogDate, entry.LogMessage);
}
}
protected override void OnLoad(EventArgs e)
{
if (DesignMode) return;
ProcessQueue_PropertyChanged(this, new PropertyChangedEventArgs(null));
}
private async void cancelAllBtn_Click(object? sender, EventArgs e)
{
ViewModel.Queue.ClearQueue();
@@ -155,7 +149,7 @@ internal partial class ProcessQueueControl : UserControl
ViewModel.Queue.MoveQueuePosition(item, position.Value);
}
}
catch(Exception ex)
catch (Exception ex)
{
Serilog.Log.Logger.Error(ex, "Error handling button click from queued item");
}