public partial class AA: Window
{
private DispatcherTimer timer;
public AA()
{
InitializeComponent();
Loaded += new RoutedEventHandler(Window1_Loaded);
}
void Window1_Loaded(object sender, RoutedEventArgs e)
{
timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(5);
timer.Tick += timer1_Tick;
timer.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
// do something...
//timer.Stop();
//this.Close();
}
}