Skip to main content

Remove Redundant Type Qualifier (XAML)


Removes a redundant type qualifier when the target type is defined, for example, on a style setter. This can improve code readability.


Available when the cursor is in a redundant type qualifier.

How to Use

  1. Place the caret in a property redundant type qualifier (for example, “CheckBox.Template”).

    <Style x:Key="checkBoxStyle" TargetType="{x:Type CheckBox}">
        <Setter Property="CheckBox.Template">
                <ControlTemplate TargetType="{x:Type CheckBox}">      
                    <BulletDecorator Background="Transparent">
                            <Grid Width="13" Height="13">
                                <Border x:Name="Border" 
                                    Background="{TemplateBinding Background}" 
                                    BorderBrush="{TemplateBinding BorderBrush}" 
                                    BorderThickness="{TemplateBinding BorderThickness}"/>
                                <Path x:Name="CheckMark" 
                                    Stroke="{DynamicResource GlyphBrush}" 
                                    Data="M 3 3 L 10 10 M 3 10 L 10 3"/>
  2. Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.

  3. Select Remove Redundant Type Qualifier from the menu.

After execution, the Refactoring removes the redundant type qualifier.