ExpandCollapseToggleStyle.xaml

28 lines | 1.303 kB Blame History Raw Download
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Focusable" Value="False" />
		<Setter Property="Width" Value="30" />
		<Setter Property="Height" Value="30" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ToggleButton">
					<Border Background="Transparent">
						<Path x:Name="CheckMark" Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="Gray" />
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="CheckMark" Property="Fill" Value="{DynamicResource HighlightedBackgoundBrush}" />
						</Trigger>
						<Trigger Property="IsChecked" Value="False">
							<Setter TargetName="CheckMark" Property="Data" Value="M6,2 L10,2 L10,-2 L12,-2 L12,2 L16,2 L16,4 L12,4 L12,8 L10,8 L10,4 L6,4 L6,2 z" />
						</Trigger>
						<Trigger Property="IsChecked" Value="True">
							<Setter TargetName="CheckMark" Property="Data" Value="M6,2 L16,2 L16,4 L6,4 z" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>