private void statusItem_RunWorkerCompleted(object sender, EventArgs e) { var statusItem = (ProgressViewModel)sender; var ctxt = (StatusBarProgressContext)statusItem.Tag; // remove the item from the status bar m_composer.RemovePart(ctxt.StatusItemPart); var args = new ProgressCompleteEventArgs(statusItem.Error, statusItem.Result, statusItem.Cancelled); ctxt.ProgressComplete.Raise(this, args); }
private void statusItem_RunWorkerCompleted(object sender, EventArgs e) { var statusItem = (ProgressViewModel)sender; var ctxt = (StatusBarProgressContext)statusItem.Tag; // remove the item from the status bar m_composer.RemovePart(ctxt.StatusItemPart); var args = new ProgressCompleteEventArgs(statusItem.Error, statusItem.Result, statusItem.Cancelled); ctxt.ProgressComplete.Raise(this, args); statusItem.RunWorkerCompleted -= statusItem_RunWorkerCompleted; }