@@ -14,7 +14,9 @@ public abstract partial class PausableProgressItemViewModelBase : ProgressItemVi
1414 nameof ( IsPaused ) ,
1515 nameof ( IsCompleted ) ,
1616 nameof ( CanPauseResume ) ,
17- nameof ( CanCancel )
17+ nameof ( CanCancel ) ,
18+ nameof ( CanRetry ) ,
19+ nameof ( CanDismiss )
1820 ) ]
1921 private ProgressState state = ProgressState . Inactive ;
2022
@@ -33,9 +35,31 @@ public abstract partial class PausableProgressItemViewModelBase : ProgressItemVi
3335 public virtual bool SupportsPauseResume => true ;
3436 public virtual bool SupportsCancel => true ;
3537
38+ /// <summary>
39+ /// Override to true in subclasses that support manual retry after failure.
40+ /// Defaults to false so unrelated progress item types are never affected.
41+ /// </summary>
42+ public virtual bool SupportsRetry => false ;
43+
44+ /// <summary>
45+ /// Override to true in subclasses that support dismissing a failed item,
46+ /// which runs full sidecar cleanup before removing the entry.
47+ /// </summary>
48+ public virtual bool SupportsDismiss => false ;
49+
3650 public bool CanPauseResume => SupportsPauseResume && ! IsCompleted && ! IsPending ;
3751 public bool CanCancel => SupportsCancel && ! IsCompleted ;
3852
53+ /// <summary>
54+ /// True only when this item supports retry AND is in the Failed state.
55+ /// </summary>
56+ public bool CanRetry => SupportsRetry && State == ProgressState . Failed ;
57+
58+ /// <summary>
59+ /// True only when this item supports dismiss AND is in the Failed state.
60+ /// </summary>
61+ public bool CanDismiss => SupportsDismiss && State == ProgressState . Failed ;
62+
3963 private AsyncRelayCommand ? pauseCommand ;
4064 public IAsyncRelayCommand PauseCommand => pauseCommand ??= new AsyncRelayCommand ( Pause ) ;
4165
@@ -51,6 +75,16 @@ public abstract partial class PausableProgressItemViewModelBase : ProgressItemVi
5175
5276 public virtual Task Cancel ( ) => Task . CompletedTask ;
5377
78+ private AsyncRelayCommand ? retryCommand ;
79+ public IAsyncRelayCommand RetryCommand => retryCommand ??= new AsyncRelayCommand ( Retry ) ;
80+
81+ public virtual Task Retry ( ) => Task . CompletedTask ;
82+
83+ private AsyncRelayCommand ? dismissCommand ;
84+ public IAsyncRelayCommand DismissCommand => dismissCommand ??= new AsyncRelayCommand ( Dismiss ) ;
85+
86+ public virtual Task Dismiss ( ) => Task . CompletedTask ;
87+
5488 [ RelayCommand ]
5589 private Task TogglePauseResume ( )
5690 {
0 commit comments