Message Reports
Default Response Actions
Interacting with the messages of RadChat
is done through ResponseAction
objects. There are two predefined ones for the Commit
and Cancel
operations. They should be added to the ReportActions
collection of the given message. Each ReportAction can have its Message
and Text
properties set.
CommitResponseAction
CancelResponseAction
Their visual representation may vary depending on the type of message. For example, the default CommitResponseAction that is defined for the CalendarMessage
would appear as a Submit
button shown below.
CalendarMessage
Adding a CancelResponseAction
CancelResponseAction
will have the following output.
CalendarMessage with a CancelResponseAction
Handling the Response
The user's interaction is handled through the ReportMessageResult
event. Its event arguments are of the type of MessageResultEventArgs
and expose the following properties:
-
Message
: Provides information regarding the message that raises the current report. -
TextMessageResult
: The result that will be posted as a text message can be controlled through it. -
PropertyName
: Provides information of the property that has been edited. For example, for aCalendarMessage
it would be theSelectedDate
property. -
DataObjectResult
: The data object value of the posted result. -
PostResultInline
: A boolean property that indicates whether the text result should be posted as an inline message. -
CloseAfterReport
: A boolean property that controls whether the message should be removed after the report. -
MessageReportType
: Gets the message report type. It is of enum type and can either have a Commit orCancel
value.
Handling the ReportMessageResult event
Submit
button for the previously defined CalendarMessage
the result will be as in the figure below.
Handling the ReportMessageResult
Custom ResponseAction
A custom ResponseAction
provides the ability to trigger a custom ICommand
instead of handling the Response through the ReportMessageResult
event. This is done by inheriting the abstract ResponseAction
object.