All docs
V19.2
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Remove Redundant Type Qualifier (XAML)

Purpose

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

Availability

Available when the cursor is in a redundant type qualifier.

How to Use

  1. Place the caret in a property redundant type qualifier.
NOTE

The blinking cursor shows the caret's position where Refactoring is available.

<Style x:Key="checkBoxStyle" TargetType="{x:Type CheckBox}">
    <Setter Property="CheckBox.Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type CheckBox}">      
                <BulletDecorator Background="Transparent">
                    <BulletDecorator.Bullet>
                        <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}" 
                                StrokeThickness="2"
                                SnapsToDevicePixels="False"
                                Data="M 3 3 L 10 10 M 3 10 L 10 3"/>
                        </Grid>
                    </BulletDecorator.Bullet>
                </BulletDecorator>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
  1. Use the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions Menu.

  2. Select Remove Redundant Type Qualifier from the menu.

After execution, the Refactoring removes the redundant type qualifier.

RemoveQualifier