MVVM Source Generators: Advanced Scenarios
Introduction
Welcome to the second article of my mini-series about MVVM Source Generators for C# .NET. In the previous post, I discussed the basics and most important features that the MVVM Community Toolkit provides, specifically attributes that can...
blog.ewers-peters.de11 min read
Hi Julian. For some reason I can´t get fully async, I mean, UI is mostly blocked and any loading spinner either freeze or don't show at all.
Commenting your las code for clarity:
[RelayCommand] private async Task PrintAddressAsync() { //UI is blocked and IsRunning is false if (Copies < 1) return;
//This line releases the UI, IsRunning sets to true and it shows the loading spinner await Task.Delay(TimeSpan.FromSeconds(2));
//Now, the UI is blocked again and the spinner is frozen OnPrintAddress?.Invoke(FullAddress); }
The only way to get really async is wrapping everything in Task.Run.
Any thoughts?