I have a MainWindow
class that launches "baloon" process. It opens a new window within a baloon start to move.
In my MainWindow class, I want to have the number of baloon launched process in real-time, that's why, when I manually close a Baloon Window, I want the MainWindow class to be warned.
Here's what I already wrote :
private void LaunchBaloonProces(object sender, RoutedEventArgs e)
{
if (countBaloonProcess() < 5) {
Application app = System.Windows.Application.Current;
ClassLibrary1.Ballon b = new Ballon();
Thread unThread = new Thread(new ThreadStart(b.Go));
unThread.Start();
if (allPaused) unThread.Suspend();
unThread.Name = "Ballon";
processList.AddLast(unThread);
refreshInformations(); // <= Here's the method Thread child should call
}
else {
informations.SetValue(TextBox.TextProperty, "Can't create more than 5 baloons");
}
}