タイマーが起動するたびにアプリ全体が応答しなくなりますか、それともプロセス全体が速すぎて気付かないでしょうか?
私の想定では、DispatcherTimerでコードを同期的に呼び出している可能性があります。これにより、短時間の無応答(およびおそらく砂時計)が発生する可能性があります。これを回避するには、DispatcherのTickイベントが非同期コードであることを確認してください。
これは、3秒ごとに、1秒間の偽の作業を実行してから、GUIを更新する簡単な小さな例です。
public partial class MainWindow : Window
{
private static int foo = 0;
public MainWindow()
{
InitializeComponent();
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromMilliseconds(3000);
timer.Tick += new EventHandler(delegate(object o, EventArgs args)
{
StatusBox.Text = "Incrementing";
ThreadStart start = delegate()
{
// Simulate work
Thread.Sleep(1000);
// Update gui
this.Dispatcher.BeginInvoke(new Action(delegate
{
CountingBox.Text = (foo++).ToString();
StatusBox.Text = "Waiting";
}));
};
new Thread(start).Start();
});
timer.Start();
}
}
(同じ目標を達成する方法は他にもありますが、これは簡単に実行できます。詳細については、こちらのガイダンスを参照してください:http: //msdn.microsoft.com/en-us/magazine/cc163328.aspx)