C#-InvalidDependencyPropertyDeclaration¶
Follow the guidelines for creating dependency properties
Required inputs: CSharpAST
- A regular CLR property (having the name given in the register invocation) has to be provided.
- The dependency property static field has to be named by suffixing the name of the property with "Property".
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
not_found |
Could not find CLR property accessors for dependency property “{0}”. |
None |
False |
unexpected_name |
Expected the name “{0}Property” for declaring static field of dependency property “{0}”. |
None |
False |
Options¶
This rule shares the following common options: excludes, includes, justification_checker, post_processing, provider, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
check_name_of_static_field¶
check_name_of_static_field : bool = True
dependency_property_class¶
dependency_property_class : str = 'System.Windows.DependencyProperty'
register_methods¶
register_methods : list[str] = ['Register']