Back to Devexpress

XAF0029: Use the enclosing property name in a method call

expressappframework-404216-debugging-testing-and-error-handling-code-diagnostics-xaf0029.md

latest1.0 KB
Original Source

XAF0029: Use the enclosing property name in a method call

  • Feb 13, 2023

Severity: Warning

Specify the property name parameter in the method so that it matches the enclosing property. Use CodeRush templates to implement XPO properties and avoid typing and copy-paste mistakes.

To ensure the UI is consistent, business classes should notify your XAF application when their property values change. Refer to the following topic for more information: The Importance of Property Change Notifications for Automatic UI Updates.

Examples

Invalid Code

csharp
string name;
public string Name {
    get { return name; }
    set { SetPropertyValue("Age", ref name, value); }
}

Valid Code

csharp
string name;
public string Name {
    get { return name; }
    set { SetPropertyValue(nameof(Name), ref name, value); }
}