Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Async not stopping in code when task was end

$
0
0

HI ,

Im using the following code in a-sync and the problem is that after i get the data (from the GetUsersData();) 

the screen is invoked and the code is not reach to the isServiceValid,how can I change it that the 

code after the task will be called also,when I put break-point on the code after the task its not stopped...

                

Task.Factory.StartNew(() => { //-----get service Data --------- try { GetUsersData(); } catch (Exception e) { _isValid = false; ThrowErrorMessage(e.Message); } }) .ContinueWith((task) => { Mouse.OverrideCursor = null; }, System.Threading.CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());

isServiceValid = true;




Viewing all articles
Browse latest Browse all 18858

Trending Articles