Added an ActivityLock for locking into an activity state

This commit is contained in:
TheXamlGuy
2024-06-15 20:15:58 +01:00
parent a1784d75b8
commit d949a1d48e
2 changed files with 17 additions and 24 deletions
-22
View File
@@ -21,13 +21,6 @@ public class ContentDialogHandler(IDispatcher dispatcher) :
{
if (content is IPrimaryConfirmation primaryConfirmation)
{
List<Action> postActions = [];
if (content is IActivityIndicator activityIndicator)
{
activityIndicator.Active = true;
postActions.Add(() => activityIndicator.Active = false);
}
Deferral deferral = args.GetDeferral();
if (!await primaryConfirmation.Confirm())
{
@@ -36,10 +29,6 @@ public class ContentDialogHandler(IDispatcher dispatcher) :
}
deferral.Complete();
foreach (Action action in postActions)
{
action.Invoke();
}
}
}
}
@@ -52,13 +41,6 @@ public class ContentDialogHandler(IDispatcher dispatcher) :
{
if (content is ISecondaryConfirmation secondaryConfirmation)
{
List<Action> postActions = [];
if (content is IActivityIndicator activityIndicator)
{
activityIndicator.Active = true;
postActions.Add(() => activityIndicator.Active = false);
}
Deferral deferral = args.GetDeferral();
if (!await secondaryConfirmation.Confirm())
{
@@ -67,10 +49,6 @@ public class ContentDialogHandler(IDispatcher dispatcher) :
}
deferral.Complete();
foreach (Action action in postActions)
{
action.Invoke();
}
}
}
}