I have a WPF application like this.
namespace WpfApplication1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public delegate void NextPrimeDelegate();
int i = 0;
public MainWindow()
{
InitializeComponent();
}
public void CheckNextNumber()
{
i++;
textBox1.Text= i.ToString();
Dispatcher.BeginInvoke(
System.Windows.Threading.DispatcherPriority.SystemIdle,
new NextPrimeDelegate(this.CheckNextNumber));
}
private void button1_Click(object sender, RoutedEventArgs e)
{
Dispatcher.BeginInvoke(
DispatcherPriority.Normal,
new NextPrimeDelegate(CheckNextNumber));
}
}
Above code is working without problem.My question is:I want to call more than a function that is called CheckNextNumber. For example:I have to make something like this.
tr[0].Start();
tr[0].Stop();