Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1266 #1267

Merged
merged 1 commit into from
Apr 10, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 53 additions & 28 deletions MahApps.Metro/Styles/Controls.Expander.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
<Setter TargetName="Arrow" Property="Data" Value="M 1,4.5 L 4.5,1 L 8,4.5" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource GrayBrush8}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource GrayBrush8}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource BlackColorBrush}" />
<Setter TargetName="Circle" Property="StrokeThickness" Value="2" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource BlackColorBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -123,13 +123,13 @@
<Setter TargetName="Arrow" Property="Data" Value="M 1,4.5 L 4.5,1 L 8,4.5" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource GrayBrush8}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource GrayBrush8}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource BlackColorBrush}" />
<Setter TargetName="Circle" Property="StrokeThickness" Value="2" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource BlackColorBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -189,13 +189,13 @@
<Setter TargetName="Arrow" Property="Data" Value="M 1,4.5 L 4.5,1 L 8,4.5" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource GrayBrush8}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource GrayBrush8}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource BlackColorBrush}" />
<Setter TargetName="Circle" Property="StrokeThickness" Value="2" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource BlackColorBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -244,13 +244,13 @@
<Setter TargetName="Arrow" Property="Data" Value="M 1,4.5 L 4.5,1 L 8,4.5" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource GrayBrush8}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource GrayBrush8}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Circle" Property="Stroke" Value="{DynamicResource BlackColorBrush}" />
<Setter TargetName="Circle" Property="StrokeThickness" Value="2" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource WhiteColorBrush}" />
<Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource BlackColorBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -292,15 +292,39 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Expander}">
<DockPanel x:Name="ExpanderRoot">
<Border x:Name="HeaderSite"
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver" />
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="DisabledVisualElement">
<SplineDoubleKeyFrame KeyTime="0"
Value="0.7" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="ExpanderRoot">
<EasingDoubleKeyFrame KeyTime="0"
Value="0.3" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="DisabledVisualElement"
Fill="{DynamicResource ControlsDisabledBrush}"
IsHitTestVisible="false"
Opacity="0" />
<DockPanel x:Name="ExpanderRoot">
<Border x:Name="HeaderSite"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
DockPanel.Dock="Top">
<DockPanel>

<ToggleButton x:Name="ToggleSite"
<DockPanel>
<ToggleButton x:Name="ToggleSite"
Margin="2"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Expand All @@ -312,17 +336,17 @@
Mode=TwoWay,
RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource ExpanderDownHeaderStyle}" />
<ContentPresenter Margin="{TemplateBinding Padding}"
<ContentPresenter Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
RecognizesAccessKey="True"
TextElement.FontSize="{TemplateBinding Controls:ControlsHelper.HeaderFontSize}"
TextElement.FontStretch="{TemplateBinding Controls:ControlsHelper.HeaderFontStretch}"
TextElement.FontWeight="{TemplateBinding Controls:ControlsHelper.HeaderFontWeight}" />
</DockPanel>
</Border>
<Border x:Name="ExpandSite"
</DockPanel>
</Border>
<Border x:Name="ExpandSite"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Background="Transparent"
Expand All @@ -332,12 +356,13 @@
Focusable="false"
Opacity="0"
Visibility="Collapsed">
<ContentPresenter Margin="{TemplateBinding Padding}"
<ContentPresenter Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Cursor="{TemplateBinding Cursor}" />
</Border>
</DockPanel>
</Border>
</DockPanel>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" />
Expand Down