locked
WPF StatusBar Item Not Updated On Time RRS feed

  • Question

  • Hi,

    I have a XAML that defines a main window, that contains a stack panel in which there's a grid and a status bar.

    One of the items in the status bar is a text box that should inform the user that a certain time-consuming operation is going on. This operation is performed each time a dedicated DispatcherTimer ticks. The operation is performed by a non-managed C++ DLL function.

    Here's my code (somewhat simplified):

      private void MyTimerTickHandler(object oSender, System.EventArgs args)
      {
        this.textblockOperationInfo.Text = "The operation is now going on";
        time_consuming_dll_function();
        this.textblockOperationInfo.Text =  string.Empty;
      }

    The problem is that the status bar isn't updated until the timer function completes, so the user always sees an empty status bar item.

    How can I force the status bar (and actually other visuals as well) update on the spot?

    Thanks in advance,

    Ofer.


    Ofer

    Tuesday, August 28, 2012 3:22 PM

Answers

All replies