Boas pessoal, estava a tentyar um exemplo que vi no site da microsoft em therading para execução sem bloquear o UI mas isto não me está a funcioanr , bloqueia o Programa até terminar a execução. Alguem sabe o que poderá ser ?
TimeSpan delay = TimeSpan.FromMinutes(0);
ThreadPoolTimer DelayTimer = ThreadPoolTimer.CreateTimer(
(source) =>
{
// Update the UI thread by using the UI core dispatcher.
//
Dispatcher.RunAsync(
CoreDispatcherPriority.High,
() =>
{
string t = "";
for (int i = 0; i < 50000000; i++)
{
t = (i - i / 2).ToString();
}
txt2.Text = "ok";
});
}, delay);