Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress Dialog & Enhancements #706

Merged
merged 6 commits into from
Jul 8, 2024
Merged

Progress Dialog & Enhancements #706

merged 6 commits into from
Jul 8, 2024

Conversation

enisn
Copy link
Owner

@enisn enisn commented Jul 8, 2024

Now it's possible to show progress as a dialog

image

    using (await DialogService.DisplayCancellableProgressAsync("Loading", "Work in progress, please wait...", "Cancel"))
    {
        // Indicate a long running operation
        await Task.Delay(5000);
    }

OR cancellable progress

private async void Button_Clicked(object sender, EventArgs e)
{
    var cts = new CancellationTokenSource();

    using (var progress = await DialogService.DisplayCancellableProgressAsync(
        "Loading", "Work in progress, please wait...", "Cancel", cts))
    {
        try
        {
            // Indicate a long running operation
            await Task.Delay(5000, cts.Token);
        }
        catch (TaskCanceledException)
        {
            // Handle cancellation
            Console.WriteLine("Progress dialog cancelled");
        }
    }
}

image

@enisn enisn added this to the v2.9 milestone Jul 8, 2024
@enisn enisn added feature 🎉 documentation 📄 Improvements or additions to documentation labels Jul 8, 2024
@enisn enisn merged commit d565e5e into develop Jul 8, 2024
2 checks passed
@enisn enisn deleted the dialogs-enhanced branch July 8, 2024 17:51
@enisn enisn mentioned this pull request Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-dialogs documentation 📄 Improvements or additions to documentation feature 🎉
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant