Skip to main content
All docs
V25.1
  • .NET Framework 4.6.2+

    XAF0029: Use the enclosing property name in a method call

    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

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

    Valid Code

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