Use the Dispatcher object to make your method run after all the ‘background’ operations are completed, as follows:
public Window1()
{
InitializeComponent();
this.Dispatcher.BeginInvoke(DispatcherPriority.Background, new SomeMethodDelegate(DoSomething));
}
private delegate void SomeMethodDelegate();
private void DoSomething()
{
MessageBox.Show('Everything is loaded.');
}
Share with