some changes for progress

This commit is contained in:
Burak Kaan Köse
2025-10-31 01:41:51 +01:00
parent 4bf8f8b3d3
commit 3cc1d10b87
8 changed files with 170 additions and 53 deletions
@@ -20,14 +20,14 @@ public partial class MergedAccountMenuItem : MenuItemBase<MergedInbox, IMenuItem
/// Total items to sync across all merged accounts.
/// </summary>
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(SynchronizationProgress))]
[NotifyPropertyChangedFor(nameof(SynchronizationProgress), nameof(IsSynchronizationProgressVisible), nameof(IsProgressIndeterminate))]
public partial int TotalItemsToSync { get; set; }
/// <summary>
/// Remaining items to sync across all merged accounts.
/// </summary>
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(SynchronizationProgress))]
[NotifyPropertyChangedFor(nameof(SynchronizationProgress), nameof(IsSynchronizationProgressVisible), nameof(IsProgressIndeterminate))]
public partial int RemainingItemsToSync { get; set; }
/// <summary>
@@ -50,6 +50,17 @@ public partial class MergedAccountMenuItem : MenuItemBase<MergedInbox, IMenuItem
}
}
/// <summary>
/// Whether synchronization progress should be visible.
/// Visible when there's active synchronization (TotalItemsToSync > 0 or RemainingItemsToSync > 0).
/// </summary>
public bool IsSynchronizationProgressVisible => TotalItemsToSync > 0 || RemainingItemsToSync > 0;
/// <summary>
/// Whether progress should be indeterminate.
/// </summary>
public bool IsProgressIndeterminate => TotalItemsToSync == 0 && IsSynchronizationProgressVisible;
[ObservableProperty]
private string mergedAccountName;