Exemplo n.º 1
0
        public async void AsyncProgress()
        {
            // Dispatcher from main thread(UI thread)
            var dispatcher = Dispatcher.CurrentDispatcher;
            await Task.Run(() =>
            {
                for (int i = 0; i < 6; i++)
                {
                    // Call js function in UI thread.
                    dispatcher.Invoke(() =>
                    {
                        Client.showProgressAsync(i);
                    });

                    System.Threading.Thread.Sleep(1000);
                }
            });
        }