I'm in the process of re-writing a WinForms app in WPF and I've run into section of code that updates a textbox (from another thread). In a nutshell, the function that updates the textbox looks like this:
// tbStatus is the textbox, of course
if ((tbStatus != null) && (!tbStatus.IsDisposed) && (!tbStatus.Disposing))
{
tbStatus.AppendText(text + Environment.NewLine);
}
I'm somewhat new to WPF and I don't see .IsDisposed or .Disposing properties on the WPF textbox. Is there another way to determine that a WPF control hasn't been disposed before attempting to access it?