Visual Studio 2010を使用して、Win Phoneの画像処理を行っています。画像を2秒間表示するために(スライドショーのように)、次のクラスが呼び出されます。
namespace photoBar
{
public class WaitTwoSeconds
{
DispatcherTimer timer = new DispatcherTimer();
public bool timeUp = false;
// This is the method to run when the timer is raised.
private void TimerEventProcessor(Object myObject,
EventArgs myEventArgs)
{
timer.Stop();
timeUp = true;
}
public WaitTwoSeconds()
{
/* Adds the event and the event handler for the method that will
process the timer event to the timer. */
timer.Tick += new EventHandler(TimerEventProcessor);
// Sets the timer interval to 2 seconds.
timer.Interval = new TimeSpan(0, 0, 2); // one second
timer.Start();
//// Runs the timer, and raises the event.
while (timeUp== false)
{
// Processes all the events in the queue.
Application.DoEvents();
}
}
}
}
これは次のように呼び出されます。
WaitTwoSeconds waitTimer = new WaitTwoSeconds();
while (!waitTimer.timeUp)
{
}
はエラーとして要求されているため、Application.DoEvents();
「System.Windows.Application」には「DoEvents」の定義が含まれていません。だから私はそのコードブロックを削除しました
while (timeUp== false)
{
// Processes all the events in the queue.
Application.DoEvents();
}
プログラムをコンパイルして実行すると、履歴書が表示されます...
これを修正するにはどうすればよいですか?ありがとう