StatusService Component - kaisu1986/ATF GitHub Wiki
StatusService
provides a global status text panel on the far left side of the Application's StatusBar. It also adds a display to show an operation's progress.
StatusService
implements the IStatusService
interface. There are versions of StatusService
and IStatusService
for both WinForms and WPF. Both IStatusService
interfaces offer similar capabilities, but with a different API. In addition, the WinForms version allows adding an extra text item and an image to the status panel.
This component, or one like it, is useful to any application that wants to show status messages and is used by most of the ATF samples. To use it, add StatusService
to the MEF TypeCatalog
of the application.
In WinForms, StatusService
is required by CommandService
.
To show a message, you have to acquire a StatusService
object using a MEF import. The section Getting a SettingsService Object describes getting a SettingService
object, and the process is similar for getting a StatusService
object. For more details on MEF importing, see MEF Attributes.
After a StatusService
object is obtained, simply invoke ShowStatus()
with the message, as in this line:
if (m_statusService != null)
m_statusService.ShowStatus(Localizer.Localize("Rename Event"));