Search posts, tags, users, and pages
Intercept property setters and say goodbye to writing busy flags
Julian Ewers-Peters
@ewerspej · Germany
Mobile App Developer
I am a passionate mobile app and software developer with a focus on C# .NET, Xamarin.Forms and .NET MAUI.
Markdown supported · ⌘↵ to post
AthosXtreme
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?
AthosXtreme
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?