Hi there,
There are many reasons for UWP freezing, including code endless loops, asynchronous methods are not handled properly, program errors, etc. Most of them occur in asynchronous method processing and UI rendering.
If your app first freezes, and then crashes after some time, then this could be because your tasks don't have correct exception handling. You might consider adding an UnobservedTaskException handler to your code to help you find this problem.
TaskScheduler.UnobservedTaskException Event https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.taskscheduler.unobservedtaskexception?view=netframework-4.8
I would also suggest you try to use the Visual Studio debugger to find out what the code is doing.
------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer–