wpf-devexpress-dot-xpf-dot-core-dot-cancelroutedeventargs.md
Gets or sets whether the event should be canceled.
Namespace : DevExpress.Xpf.Core
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public bool Cancel { get; set; }
Public Property Cancel As Boolean
| Type | Description |
|---|---|
| Boolean |
true, if the event should be canceled; otherwise, false.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the Cancel property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-diagram-track-and-restrict-drag-actions/CS/WpfApp7/MainWindow.xaml.cs#L15
private void DiagramDesignerControl_AddingNewItem(object sender, DiagramAddingNewItemEventArgs e) {
e.Cancel = (e.Item is DiagramShape shape && shape.Shape == BasicShapes.Rectangle);
e.Handled = true;
if ((int)draggedAppointment.LabelId == 1 && (draggedAppointment.Start != ((MedicalAppointment)draggedAppointmentSource.SourceObject).StartTime))
e.Cancel = true;
}
If draggedAppointment.LabelId IsNot Nothing Then
If CInt(draggedAppointment.LabelId) = 1 AndAlso (draggedAppointment.Start <> CType(draggedAppointmentSource.SourceObject, MedicalAppointment).StartTime) Then e.Cancel = True
End If
See Also