JetBrains Rider 2024.3 Help

Code Inspections in XAML

In XAML, JetBrains Rider 2024.3 provides two kinds of code inspections: 4 inspections that detect errors such as broken syntax, unresolved symbols, compiler errors, and so on (you cannot configure or disable any of these inspections), and 76 proprietary code inspections, any of which you can disable or change its severity level.
These code inspections help you detect code issues in design time in all open files, and additionally they allow you to find code issues in specific scope.

Configurable XAML inspections are listed below, grouped by their categories.

Code Notification (26 inspections)

This category groups code inspections with minor severity levels.

Inspection


ID


EditorConfig property

Default severity

{DynamicResource} can only be used with dependency property


Xaml.DynamicResourceError


resharper_xaml_dynamic_resource_error_highlighting

Error

Constructor not resolved


Xaml.ConstructorWarning


resharper_xaml_constructor_warning_highlighting

Warning

Decimal numbers parsed depending on current machine culture


Xaml.DecimalParsingIsCultureDependent


resharper_xaml_decimal_parsing_is_culture_dependent_highlighting

Warning

Dependency property descriptor field missing


Xaml.DependencyPropertyResolveError


resharper_xaml_dependency_property_resolve_error_highlighting

Warning

Element name reference is not resolved


Xaml.ElementNameReferenceNotResolved


resharper_xaml_element_name_reference_not_resolved_highlighting

Error

Grid columns/rows definitions can be converted to attribute


Xaml.GridDefinitionsCanBeConvertedToAttribute


resharper_xaml_grid_definitions_can_be_converted_to_attribute_highlighting

Hint

Grid length definition must not be empty


Xaml.EmptyGridLengthDefinition


resharper_xaml_empty_grid_length_definition_highlighting

Error

Ignored path


Xaml.IgnoredPathHighlighting


resharper_xaml_ignored_path_highlighting_highlighting

Disabled

Mapped path


Xaml.MappedPathHighlighting


resharper_xaml_mapped_path_highlighting_highlighting

Hint

Member of invalid type


Xaml.InvalidMemberType


resharper_xaml_invalid_member_type_highlighting

Error

Method arguments will be replaced by event's arguments in generated code


Xaml.MethodArgumentsWillBeIgnored


resharper_xaml_method_arguments_will_be_ignored_highlighting

Warning

Multiple overloads with same arguments count found


Xaml.OverloadsCollision


resharper_xaml_overloads_collision_highlighting

Warning

Object/markup extension of invalid type


Xaml.InvalidType


resharper_xaml_invalid_type_highlighting

Error

Parent is outside the current component tree


Xaml.ParentIsOutOfCurrentComponentTree


resharper_xaml_parent_is_out_of_current_component_tree_highlighting

Warning

Path to resource is case-sensitive


Xaml.ResourceFilePathCaseMismatch


resharper_xaml_resource_file_path_case_mismatch_highlighting

Warning

Routed event descriptor field missing


Xaml.RoutedEventResolveError


resharper_xaml_routed_event_resolve_error_highlighting

Warning

Static resource not resolved


Xaml.StaticResourceNotResolved


resharper_xaml_static_resource_not_resolved_highlighting

Warning

Style class not found


Xaml.StyleClassNotFound


resharper_xaml_style_class_not_found_highlighting

Warning

Unresolved binding path when DataContext is known


Xaml.BindingWithContextNotResolved


resharper_xaml_binding_with_context_not_resolved_highlighting

Warning

Unresolved binding path when DataContext is unknown


Xaml.BindingWithoutContextNotResolved


resharper_xaml_binding_without_context_not_resolved_highlighting

Hint

Using stream binding operator in TwoWay or OneWayToSource binding modes


Xaml.AvaloniaWrongBindingModeForStreamBindingOperator


resharper_xaml_avalonia_wrong_binding_mode_for_stream_binding_operator_highlighting

Warning

x:DataType not specified for CompiledBinding


Xaml.CompiledBindingMissingDataTypeErrorHighlighting


resharper_xaml_compiled_binding_missing_data_type_error_highlighting_highlighting

Error

x:FieldModifier attribute requires x:Name attribute


Xaml.FieldModifierRequiresNameAttribute


resharper_xaml_field_modifier_requires_name_attribute_highlighting

Warning

XAML dynamic resource of invalid type


Xaml.InvalidDynamicResourceType


resharper_xaml_invalid_dynamic_resource_type_highlighting

Suggestion

XAML resource of invalid type


Xaml.InvalidResourceType


resharper_xaml_invalid_resource_type_highlighting

Error

XAML style of invalid target type


Xaml.InvalidResourceTargetType


resharper_xaml_invalid_resource_target_type_highlighting

Error

Common Practices and Code Improvements (3 inspections)

This category groups inspections that hunt for medium severity issues that mainly affect code readability.

Inspection


ID


EditorConfig property

Default severity

Member can be made private (non-private accessibility)


MemberCanBePrivate.Global


resharper_member_can_be_private_global_highlighting

Suggestion

Member can be made protected (non-private accessibility)


MemberCanBeProtected.Global


resharper_member_can_be_protected_global_highlighting

Suggestion

Member or type can be made internal (friend)


MemberCanBeInternal


resharper_member_can_be_internal_highlighting

Disabled

Compiler Warnings (2 inspections)

Inspections in this category detect compiler warnings before you compile.

Inspection


ID


EditorConfig property

Default severity

Use of obsolete type or type member


ObsoleteElement


resharper_obsolete_element_highlighting

Warning

Use of obsolete type or type member (error)


ObsoleteElementError


resharper_obsolete_element_error_highlighting

Error

Constraints Violations (2 inspections)

This category includes code inspections, mostly with the warning severity level, which detect violations related to symbol attributes, including JetBrains Rider's code annotations, and other similar issues.

Inspection


ID


EditorConfig property

Default severity

Inconsistent Naming


InconsistentNaming


resharper_inconsistent_naming_highlighting

Warning

Possible 'null' assignment to non-nullable entity


Xaml.AssignNullToNotNullAttribute


resharper_xaml_assign_null_to_not_null_attribute_highlighting

Warning

Grammar Issues (4 inspections)

Inspections in this category report grammar issues in string literals and documentation comments.

Inspection


ID


EditorConfig property

Default severity

Grammar error in comment


GrammarMistakeInComment


resharper_grammar_mistake_in_comment_highlighting

Suggestion

Grammar error in markup attribute value


GrammarMistakeInMarkupAttribute


resharper_grammar_mistake_in_markup_attribute_highlighting

Suggestion

Grammar error in markup text


GrammarMistakeInMarkupText


resharper_grammar_mistake_in_markup_text_highlighting

Suggestion

Grammar error in string literal


GrammarMistakeInStringLiteral


resharper_grammar_mistake_in_string_literal_highlighting

Disabled

Potential Code Quality Issues (18 inspections)

This category includes inspections that detect critical issues (code smells), mostly with Error or Warning level. This category also includes inspections that ensure localization assistance.

Inspection


ID


EditorConfig property

Default severity

DeviceFamily-specific view type name does not match generic type name


Xaml.XamlMismatchedDeviceFamilyViewClrNameHighlighting


resharper_xaml_xaml_mismatched_device_family_view_clr_name_highlighting_highlighting

Warning

Duplicate device family view


Xaml.XamlDuplicateDeviceFamilyTypeViewHighlighting


resharper_xaml_xaml_duplicate_device_family_type_view_highlighting_highlighting

Error

Duplicate style property/event setter


Xaml.DuplicateStyleSetter


resharper_xaml_duplicate_style_setter_highlighting

Warning

Grid element column/row index is out of grid definition range


Xaml.IndexOutOfGridDefinition


resharper_xaml_index_out_of_grid_definition_highlighting

Warning

Missing grid column/row setter for non-first child


Xaml.MissingGridIndex


resharper_xaml_missing_grid_index_highlighting

Warning

Non-accessed field (non-private accessibility)


NotAccessedField.Global


resharper_not_accessed_field_global_highlighting

Suggestion

Non-accessed field (private accessibility)


NotAccessedField.Local


resharper_not_accessed_field_local_highlighting

Warning

Path error


Xaml.PathError


resharper_xaml_path_error_highlighting

Warning

Possible 'null' value in the path of binding without fallback value


Xaml.PossibleNullReferenceException


resharper_xaml_possible_null_reference_exception_highlighting

Suggestion

RelativeSourceMode is not set explicitly


Xaml.XamlRelativeSourceDefaultModeWarningHighlighting


resharper_xaml_xaml_relative_source_default_mode_warning_highlighting_highlighting

Warning

Resource cannot be accessed by class name because of x:Key attribute


Xaml.RedundantXamarinFormsClassDeclaration


resharper_xaml_redundant_xamarin_forms_class_declaration_highlighting

Warning

Style target type is not convertible to base type


Xaml.StyleInvalidTargetType


resharper_xaml_style_invalid_target_type_highlighting

Error

Types in x:DataType and BindingContext mismatch


Xaml.XamlXamarinFormsDataTypeAndBindingContextTypeMismatchedHighlighting


resharper_xaml_xaml_xamarin_forms_data_type_and_binding_context_type_mismatched_highlighting_highlighting

Warning

Unexpected element error


Xaml.UnexpectedElement


resharper_xaml_unexpected_element_highlighting

Error

Unexpected text token error


Xaml.UnexpectedTextToken


resharper_xaml_unexpected_text_token_highlighting

Error

Unknown DeviceFamily


Xaml.XamlUnknownDeviceFamilyTypeHighlighting


resharper_xaml_xaml_unknown_device_family_type_highlighting_highlighting

Warning

x:Key is allowed for resources and dictionary elements only


Xaml.XKeyAttributeDisallowed


resharper_xaml_x_key_attribute_disallowed_highlighting

Error

XAML language level error


Xaml.LanguageLevel


resharper_xaml_language_level_highlighting

Error

Redundancies in Code (13 inspections)

Code inspections in this category look for redundancies and dead code, which affect code readability and style, and could be safely removed. Some code redundancies cannot be fixed automatically, and quick-fixes for them are performed in the interactive mode, requiring the user input. But the majority of the redundancies can be fixed without user interaction, using either fix in scope or code cleanup.

Inspection


ID


EditorConfig property

Default severity

Binding mode is equal to default


Xaml.RedundantBindingModeAttribute


resharper_xaml_redundant_binding_mode_attribute_highlighting

Warning

Property value is equal to style-provided


Xaml.RedundantStyledValue


resharper_xaml_redundant_styled_value_highlighting

Warning

Redundant empty collection property setter


Xaml.RedundantCollectionProperty


resharper_xaml_redundant_collection_property_highlighting

Warning

Redundant 'Freeze' attribute


Xaml.RedundantFreezeAttribute


resharper_xaml_redundant_freeze_attribute_highlighting

Warning

Redundant modifiers attribute


Xaml.RedundantModifiersAttribute


resharper_xaml_redundant_modifiers_attribute_highlighting

Warning

Redundant name attribute


Xaml.RedundantNameAttribute


resharper_xaml_redundant_name_attribute_highlighting

Warning

Redundant namespace alias


Xaml.RedundantNamespaceAlias


resharper_xaml_redundant_namespace_alias_highlighting

Warning

Redundant property type qualifier


Xaml.RedundantPropertyTypeQualifier


resharper_xaml_redundant_property_type_qualifier_highlighting

Warning

Redundant resource


Xaml.RedundantResource


resharper_xaml_redundant_resource_highlighting

Warning

Remove redundant attached property setter


Xaml.RedundantAttachedProperty


resharper_xaml_redundant_attached_property_highlighting

Warning

Single grid row/column definition is redundant


Xaml.RedundantGridDefinitions


resharper_xaml_redundant_grid_definitions_highlighting

Warning

Single-cell grid column/row span is redundant


Xaml.RedundantGridSpan


resharper_xaml_redundant_grid_span_highlighting

Warning

UpdateSourceTrigger=Default is redundant


Xaml.RedundantUpdateSourceTriggerAttribute


resharper_xaml_redundant_update_source_trigger_attribute_highlighting

Warning

Redundancies in Symbol Declarations (4 inspections)

This category includes code inspections, mostly with the warning severity level, which detect empty and unused symbol declarations.

Inspection


ID


EditorConfig property

Default severity

Type is never used (non-private accessibility)


UnusedType.Global


resharper_unused_type_global_highlighting

Suggestion

Type is never used (private accessibility)


UnusedType.Local


resharper_unused_type_local_highlighting

Warning

Type member is never used (non-private accessibility)


UnusedMember.Global


resharper_unused_member_global_highlighting

Suggestion

Type member is never used (private accessibility)


UnusedMember.Local


resharper_unused_member_local_highlighting

Warning

Spelling Issues (4 inspections)

These inspections detect typos in various contexts.

Inspection


ID


EditorConfig property

Default severity

Typo in comment


CommentTypo


resharper_comment_typo_highlighting

Suggestion

Typo in identifier


IdentifierTypo


resharper_identifier_typo_highlighting

Suggestion

Typo in markup attribute value


MarkupAttributeTypo


resharper_markup_attribute_typo_highlighting

Suggestion

Typo in markup text


MarkupTextTypo


resharper_markup_text_typo_highlighting

Suggestion

Last modified: 06 November 2024