Reputation: 242
My question is how can i delay the autostart on user logon in an WPF Project. Because its necessary on this application.
I tried:
void OnStartup(StartupEventArgs e)
{
Thread.Sleep(60000);
base.OnStartup(e);
}
but it seems like the OnStartup method isnt aviable. Its always an error. So there is something i dont get.
Upvotes: 0
Views: 329
Reputation: 81
You can always just use
public App()
{
System.Threading.Thread.Sleep(10000)
}
on the App.xaml.cs
Of as already mentioned you need to subscribe to the OnStartup event on xaml.
Upvotes: 2
Reputation: 115
This answer might have what you're looking for:
I think what you really want to do is to subscribe to the Startup event. You can do this in your XAML file
Click here to get started with WPF
Upvotes: 0