void doFun(){};
var timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(2) };
timer.Start();timer.Tick += (sender2, args) =>
{
timer.Stop();
doFun();
};
void doFun(){};
var timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(2) };
timer.Start();