Notifications and messages

Contents

The basic communication method between the POS application and a user are notifications and messages. Notifications submits short information in a rectangle-shape box displayed on the right side of the screen below the status section. It is not blocking the user’s actions. Messages, on the other hand, submit longer or important information which a user cannot ignore since they are presented in the message view. They are commonly used in case of errors.

Notifications

Each notification is composed of content (too long text, above 6 lines, will be truncated) and an icon. There are three types of notifications differing in their icon:

1. Information

2. Warning

3. Error

A triggered notification appears on the right side of the screen and disappears after three seconds, by default. Notification display time can be changed in the application’s configuration file by modifying the key value NotificationTimeout. The notification does not dismiss when you hover the mouse cursor over it, it is then presented as long as you hold the mouse cursor within the notification area. When another notification appears while the previous one is still displayed, this first notification then moves under the new one. 5 notifications can be displayed on the screen at a time. Any subsequent notifications will be cached and presented as the currently displayed ones disappear.

In order to display notifications, you need to use the INotificationService service (each viewmodel can access this service via the NotificationService property) and invoke the Show(string msg, NotifyIcon icon) method, where msg parameter is a message and icon is an enum specifying a notification type (that is the icon).

Messages

Messages are presented with the use of the message view (description of this view can be found in Introduction). Each message consists of a headline (a short title presented in a larger font compared to the actual message), message text (not character-limited, longer text can be scrolled using a slider next to it), an optional icon (selected from several predefined ones) and at least one button. Button configuration depends on a message type, but you can also define custom configuration.

In order to display messages, you need to use the IMonitService service (each viewmodel can access this service via the MonitService property) and invoke one of the methods below, depending on the needs:

  • ShowInformation

This method displays an information message. Information icon and the [OK] button.

  • ShowError

This method displays an error message. Error icon and the [OK] button.

  • ShowQuestion

This method displays a question message. Question icon and buttons: [Yes], [No].

  • Show

This method displays a message of freely defined type. You can specify an icon (select it from among the predefined ones: information, question, warning, error or none). You also need to select action buttons ([OK], [Yes/No]) or define custom ones.

Czy ten artykuł był pomocny?