Back to Devexpress

CancelRoutedEventArgs.Cancel Property

wpf-devexpress-dot-xpf-dot-core-dot-cancelroutedeventargs.md

latest3.1 KB
Original Source

CancelRoutedEventArgs.Cancel Property

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

Declaration

csharp
public bool Cancel { get; set; }
vb
Public Property Cancel As Boolean

Property Value

TypeDescription
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

csharp
private void DiagramDesignerControl_AddingNewItem(object sender, DiagramAddingNewItemEventArgs e) {
    e.Cancel = (e.Item is DiagramShape shape && shape.Shape == BasicShapes.Rectangle);
    e.Handled = true;

wpf-scheduler-process-appointment-drag-drop-resize-operations/CS/SchedulerDragDropResizeExample/ViewModel/MainViewModel.cs#L51

csharp
if ((int)draggedAppointment.LabelId == 1 && (draggedAppointment.Start != ((MedicalAppointment)draggedAppointmentSource.SourceObject).StartTime))
            e.Cancel = true;
}

wpf-scheduler-process-appointment-drag-drop-resize-operations/VB/SchedulerDragDropResizeExample/ViewModel/MainViewModel.vb#L53

vb
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

CancelRoutedEventArgs Class

CancelRoutedEventArgs Members

DevExpress.Xpf.Core Namespace