Version

Errors

Error information is channeled through the XamScheduleDataManager and communicated to the developer via the DataErrorInfo class.

This DataErrorInfo object exposes the following properties:

Property Name Type Description

object

If the error is specific to an activity, the context will be the activity object.

String

This is more complete text that is normally not displayed to the end user but may be of help to the developer in diagnosing the issue.

Exception

The exception that triggered the error. Note: if the error was not raised as the result of an exception this property will return null.

IList<DataErrorInfo>

If there are multiple errors associated with a single event then this will return a list of these errors. Otherwise this property returns null.

ErrorSeverity

This is an enum with the following values:

  • Diagnostic – is not displayed to the end user

  • Warning - is suitable for end user display

  • Error – should be displayed to the end user

  • SevereError – this is a blocking error and indicates a state where the control cannot operate as expected

String

Text that is suitable for end user display.

DataErrorInfo objects are exposed by the following:

  1. The XamScheduleDataManager’s Error event arguments. This event is raised whenever any error is encountered. Note: by default all errors are logged to the debugger if one is attached. This can be suppressed by setting the event argument’s LogError property to false.

  2. The XamScheduleDataManager’s ErrorDisplaying event arguments. This event is raised whenever a Warning, Error or SevereError is encountered. This event can be canceled by setting the Cancel property to true. The event arguments expose a read-only property named DisplayType with the following possible values:

    1. ActivityErrorIcon – this is an activity specific error that was not triggered directly by user action. Unless canceled this will cause ActivityPresenters representing this activity to display an error icon. Their tooltips will also include the UserErrorText.

    2. MessageBox – this error was triggered by an end user action, e.g. editing an appointment and attempting to save the changes. Unless canceled this will result in a MessageBox being displayed to the user.

    3. BlockingError – a "SevereError" was encountered. Unless canceled this will set the BlockingError property of all associated view controls, i.e. xamDayView, xamMonthView and xamScheduleView. The templates for these controls contain a semi-transparent overlay element that will then display the blocking error information to the user and prevent the controls from functioning at run time. In design mode no blocking errors will be displayed. Some examples of severe or blocking errors at run time are:

      1. A view control’s DataManager property is not set. This is the only time the Error event can’t be raised since there is no XamScheduleDataManager to raise it. However, the BlockingError property will be set and as a result the overlay will be shown.

      2. The local time zone cannot be determined with 100% certainty. This is usually only an issue in Silverlight since the framework doesn’t expose this information and it must be deduced by performing date/time conversions between local and UTC times. By default this condition will result in a time zone chooser dialog being displayed to the end user. However, if the xamScheduleDataManager’s PromptForLocalTimeZone property is set to Never and the data connector’s TimeZoneProviderResolved. LocalTimeZoneId is not set then the blocking error will be shown unless the ErrorDisplaying event is canceled.

      3. The xamScheduleDataManager’s DataConnector property is set to a ListScheduleDataConnector or WcfListScheduleDataConnector and the minimum required property mappings are not specified.

  1. The xamScheduledataManager’s BeginEdit, BeginEditWithCopy, CancelEdit, and CreateNew methods can return a DataErrorInfo object as an "out" parameter.

  2. The OperationResult class exposes an Error property of type DataErrorInfo. This is the base class for the following:

    1. ActivityOperationResult - this object is returned by the xamScheduleDataManager’s EndEdit and Remove methods.

    2. ActivityQueryResult - this object is returned by the xamScheduleDataManager’s GetActivities method.

    3. CancelOperationResult - this object is returned by the xamScheduleDataManager’s CancelPendingOperation method.

Note: XamScheduleDataManager also exposes a HasPendingOperations property and a read-only PendingOperations collection that contains OperationResults that haven’t yet completed, i.e. their IsComplete property is false. When the "IsComplete" or "IsCanceled" property is changed to true the OperationResult will raise the PropertyChanged event.