The following code snippetcode has some issue, I don’t know where to place it.
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="True">
<Setter TargetName="ExpandSite"
Property="Visibility"
Value="Visible"/>
</Trigger>
</ControlTemplate.Triggers>
You have the
<ControlTemplate.Triggers>element inside the<Grid>instead of directly inside the<ControlTemplate>. Move it down after the line that has</Grid>and before the line that has</ControlTemplate>so that it is a direct child of the<ControlTemplate>element.