I used this code thinking that the app did not stop but it was not like that. How do you correctly dispatcher - RunAsync in UWP?
Code:
public sealed partial class MainPage : Page
{
List<Grid> listaGrid = new List<Grid>();
public MainPage()
{
this.InitializeComponent();
}
private async void Button_Click(object sender, RoutedEventArgs e)
{
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => {
for (int a = 0; a <= 10000000; a++)
{
listaGrid.Add(new Grid());
}
});
}
}
How can I correctly use Dispatcher - RunAsync?
Always thank you in advance..!