Back to Devexpress

Code Analyzers

wpf-404368-troubleshooting-code-analyzers.md

latest6.5 KB
Original Source

Code Analyzers

  • Apr 06, 2023
  • 2 minutes to read

Our free CodeRush Extension for Visual Studio can check WPF code for typical errors related to DevExpress WPF Controls. This extension contains analyzers that highlight detected issues in code and display them in the Error List window:

The following table lists available code analyzers:

IDTitleDescriptionXAMLC#
CRXPF0001Legacy drag-and-dropSet the DataViewBase.AllowDragDrop property to true instead of the obsolete drag-and-drop behaviors.
CRXPF0002ColumnBase.EditTemplate is usedUse the ColumnBase.CellEditTemplate property instead of the obsolete ColumnBase.EditTemplate property.
CRXPF0003FieldName is equal to the Binding pathThe FieldName and Binding properties are defined simultaneously for a column.
CRXPF0004Outdated windowsUse the ThemedWindow instead of the outdated windows.
CRXPF0005Cell template without PART_EditorSet the editor’s name to "PART_Editor" to bind and configure the editor.
CRXPF0006EditValueChanging/EditValueChanged is handled in CellTemplateHandle the CellValueChanging and CellValueChanged events instead of EditValueChanging and EditValueChanged.
CRXPF0007An invalid EventToCommand.EventNameUse a valid event name to specify the EventToCommand.EventName property.
CRXPF0008In-place editing is not available when NavigationStyle is set to Row or NoneSet the DataViewBase.NavigationStyle property to Cell to allow users to use in-place data editors to edit cell values.
CRXPF0009AutoWidth and relative column width are used togetherSet the TableView.AutoWidth property to false if you use relative (star) values to specify a column’s Width property.
CRXPF0010Use DependencyObjectExtensions.DataContext to define bindings for generated columnsDefine bindings in column templates through the DependencyObjectExtensions.DataContext attached property to increase performance.
CRXPF0011The column’s FieldName or Binding property is not definedSpecify the FieldName or Binding property to connect the column to data. To create an unbound column, set the FieldName property to a string that does not match an existing field name.
CRXPF0012Columns with the specified Binding property are read-onlySet the binding’s Mode property to TwoWay to allow users to edit column values.
CRXPF0013Missing EndUpdate callThe BeginUpdate method call requires a subsequent EndUpdate method call. Otherwise, the control’s UI remains locked.
CRXPF0014Missing BeginUpdate and EndUpdate callsCall the BeginUpdate and EndUpdate methods to process collection updates in batches.
CRXPF0015BeginUpdate call in a loopCall the BeginUpdate and EndUpdate methods outside a loop to process all updates in one batch and increase performance.

Refer to the following help topic for more information: Static Code Analysis.