Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi this code for work with thread in windows phone 8.0
C#
private void Start_Example()
 {
     for (i = 0; i < 1000; i++)
     {
         Thread.Sleep(100);
         this.Dispatcher.BeginInvoke(() =>
         {
             lblResult.Text = i.ToString();
         });
     }
 }

 private void btnStart_Click(object sender, RoutedEventArgs e)
 {
     ThreadStart st = new ThreadStart(Start_Example);
     Thread s = new Thread(st);
     s.Start();
 }

but my question is how to use thread like this code in windows phone 8.1?
With Respect
Posted

1 solution

If this is a store app, have a look at new APIs for windows phone 8.1[^]
 
Share this answer
 
Comments
Avenger1 22-Feb-15 14:07pm    
no its windows phone 8.1 app not store app
help me to fix it, please?
With Respect
Wendelius 22-Feb-15 23:27pm    
If it's not a store application, what is the exact error you're facing?
Avenger1 23-Feb-15 1:51am    
"Thread" and "ThreadStart" are not in windows phone 8.1 and in my programs i must use "thread" like this in my application in windows phone app 8.1
With Respect
Wendelius 23-Feb-15 14:40pm    
But what is the error you get?

From the documentation for ThreadStart:
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8
Avenger1 24-Feb-15 12:17pm    
i m using Windows Phone 8.1 and i can't write it
and what's different between "Windows Phone" and "Windows Phone Silverlight"?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900