Have you ever tried to set a Style on a complex WPF control, only to find it loses too much of the original styling and screws up?

You can use the BasedOn property when setting the style, but how do you tell it to inherit from a standard WPF style without having to copy and paste the entire thing into your resources?

The answer is relatively simple:

<TreeView.ItemContainerStyle>
    <Style TargetType="TreeViewItem" BasedOn="{StaticResource {x:Type TreeViewItem}}">
        <!-- Your setters here... -->
    </Style>
</TreeView.ItemContainerStyle>

Using the Type in BasedOn instead of pointing it at an actual Style isn’t very obvious but does end up working. Now you can just inherit from the stock WPF style and change one or two parameters instead of having to make your own mess.