Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# silverlight、xaml、线程问题_C#_Silverlight_Xaml_Multithreading - Fatal编程技术网

C# silverlight、xaml、线程问题

C# silverlight、xaml、线程问题,c#,silverlight,xaml,multithreading,C#,Silverlight,Xaml,Multithreading,我想要一个线程,用于轮询Web服务。 但是线程不工作 xxx.xaml.cs: public class Alpha:Page { // This method that will be called when the thread is started public void polling() { while (true) { Thread.Sleep(1

我想要一个线程,用于轮询Web服务。 但是线程不工作

xxx.xaml.cs:

public class Alpha:Page
    {

        // This method that will be called when the thread is started
        public void polling()
        {
            while (true)
            {
                Thread.Sleep(1000);
                //MessageBox.Show("polling");
                Gamedetails_Player2.show();

            }
        }
    };

class ...:Page

public Gamedetails_Player2()
        {


            // Required to initialize variables
            InitializeComponent();


            Alpha oAlpha = new Alpha();
            Thread poll = new Thread(oAlpha.polling);
            poll.Start();


            MessageBox.Show("polling started"+poll.IsAlive);
            //oAlpha.polling();
            //polling();

        }
public static void show(){MessageBox.Show("running");}
}
我的问题是线程不工作。。。它活着,但它什么也没做。。。 当我直接调用它时,它可以工作,但我希望它作为一个线程。
我期待着得到答案

试着找一个幕后工作者 您将找到如何实现这一点的文档