Back to Devexpress

CRXPF0007 - An invalid EventToCommand.EventName

coderushforroslyn-403955-static-code-analysis-xaml-analyzers-crxpf-0007-an-invalid-event-to-command-event-name.md

latest1.3 KB
Original Source

CRXPF0007 - An invalid EventToCommand.EventName

  • Feb 14, 2023

Severity: Error

The analyzer detects that the event (specified by name in the EventToCommand.EventName property) does not exist in the object associated with the EventToCommand behavior.

Examples

Invalid Code

xaml
<XXX>
    <dxmvvm:Interaction.Behaviors>
        <dxmvvm:EventToCommand EventName="NonExistingEventName"/>
    </dxmvvm:Interaction.Behaviors>
</XXX>

Valid Code

xaml
<XXX>
    <dxmvvm:Interaction.Behaviors>
        <dxmvvm:EventToCommand EventName="EventName"/>
    </dxmvvm:Interaction.Behaviors>
</XXX>

How to Fix

Use a valid event name to specify the EventToCommand.EventName property. For example, you can find a list of GridControl events in the following topic: GridControl Events.

Refer to the following help topic for more information: EventToCommand - Specify an Event.