|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:Odyssey.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Duration x:Key="animTime">0:0:0.4</Duration>
<Style TargetType="{x:Type local:OdcExpander}">
<Setter Property="Background" Value="#40808080"/>
<Setter Property="BorderBrush" Value="#60404040"/>
<Setter Property="HeaderBackground" Value="#40A0A0A0"/>
<Setter Property="MouseOverHeaderBackground" Value="#60FFFFFF"/>
<Setter Property="MouseOverHeaderForeground" Value="#F0000000"/>
<Setter Property="HeaderBorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="0"/>
<Setter Property="ShowEllipse" Value="True"/>
<Setter Property="Padding" Value="8"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:OdcExpander}">
<Border>
<StackPanel>
<local:OdcExpanderHeader x:Name="header" SnapsToDevicePixels="True"
BorderThickness="{TemplateBinding HeaderBorderThickness}"
Content="{TemplateBinding Header}"
IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsExpanded}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
Background="{TemplateBinding HeaderBackground}"
BorderBrush="{TemplateBinding BorderBrush}"
ShowEllipse="{TemplateBinding ShowEllipse}"
CornerRadius="{TemplateBinding CornerRadius}"
Image="{TemplateBinding Image}"/>
<local:AnimationDecorator Grid.Row="1" SnapsToDevicePixels="True"
Duration="{StaticResource animTime}"
MinHeight="{TemplateBinding MinHeight}"
MaxHeight="{TemplateBinding MaxHeight}"
Height="{TemplateBinding Height}"
IsExpanded="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsExpanded}">
<Border x:Name="panel" Grid.Row="1" Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderThickness="1,0,1,1"
BorderBrush="{TemplateBinding BorderBrush}">
<ContentPresenter
VerticalAlignment="Bottom"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"/>
</Border>
</local:AnimationDecorator>
</StackPanel>
<Border.LayoutTransform>
<ScaleTransform x:Name="scaleT" ScaleY="1"/>
</Border.LayoutTransform>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True" SourceName="header">
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=MouseOverHeaderForeground}" TargetName="header"/>
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=MouseOverHeaderBackground}" TargetName="header"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsPressed" Value="True" SourceName="header"/>
<Condition Property="HasPressedBackground" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=PressedHeaderBackground}" TargetName="header"/>
</MultiTrigger>
<EventTrigger RoutedEvent="local:OdcExpander.MaximizedEvent">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard Storyboard.TargetProperty="ScaleY" >
<DoubleAnimation To="1" Duration="{StaticResource animTime}" Storyboard.TargetName="scaleT" DecelerationRatio="0.8"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="local:OdcExpander.MinimizedEvent">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard Storyboard.TargetProperty="ScaleY" >
<DoubleAnimation To="0" Duration="{StaticResource animTime}" Storyboard.TargetName="scaleT" DecelerationRatio="0.8"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.