|
2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
3 | 3 | xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
|
4 | 4 | xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
5 |
| - xmlns:Actions="clr-namespace:MahApps.Metro.Actions;assembly=MahApps.Metro" > |
6 |
| - |
7 |
| - <ResourceDictionary.MergedDictionaries> |
8 |
| - |
9 |
| - </ResourceDictionary.MergedDictionaries> |
| 5 | + xmlns:Actions="clr-namespace:MahApps.Metro.Actions;assembly=MahApps.Metro" |
| 6 | + xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf" |
| 7 | + xmlns:mahApps="clr-namespace:MaterialDesignThemes.MahApps"> |
10 | 8 |
|
11 | 9 | <DataTemplate x:Key="HeaderTemplate"
|
12 | 10 | x:Shared="False">
|
13 |
| - <DockPanel x:Name="dpHeader" |
14 |
| - Margin="10,25,10,10" |
15 |
| - VerticalAlignment="Center" |
16 |
| - LastChildFill="True"> |
17 |
| - <Button x:Name="nav" |
18 |
| - Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type Controls:Flyout}}, Path=CloseCommand, Mode=OneWay}" |
19 |
| - DockPanel.Dock="Left" |
20 |
| - Style="{DynamicResource MaterialDesignToolButton}" |
21 |
| - Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:Flyout}}, Path=CloseButtonVisibility}" |
22 |
| - Height="40" |
23 |
| - Width="40" |
24 |
| - FontFamily="Segoe UI Symbol" |
25 |
| - FontSize="16" |
26 |
| - VerticalAlignment="Bottom"> |
27 |
| - <i:Interaction.Triggers> |
28 |
| - <i:EventTrigger EventName="Click"> |
29 |
| - <Actions:SetFlyoutOpenAction TargetObject="{Binding RelativeSource={RelativeSource AncestorType={x:Type Controls:Flyout}}}" |
30 |
| - Value="False" /> |
31 |
| - </i:EventTrigger> |
32 |
| - </i:Interaction.Triggers> |
33 |
| - <Viewbox Width="24" Height="24" RenderTransformOrigin="0.5,0.5"> |
34 |
| - <Viewbox.RenderTransform> |
35 |
| - <TransformGroup> |
36 |
| - <ScaleTransform ScaleY="1" ScaleX="-1"/> |
37 |
| - <SkewTransform AngleY="0" AngleX="0"/> |
38 |
| - <RotateTransform Angle="0"/> |
39 |
| - <TranslateTransform/> |
40 |
| - </TransformGroup> |
41 |
| - </Viewbox.RenderTransform> |
42 |
| - <Canvas Width="24" Height="24"> |
43 |
| - <Path Data="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" |
44 |
| - Fill="{DynamicResource MaterialDesignBody}" /> |
45 |
| - </Canvas> |
46 |
| - </Viewbox> |
47 |
| - </Button> |
48 |
| - <TextBlock Text="{Binding}" |
49 |
| - x:Name="PART_BackButton" |
50 |
| - Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:Flyout}}, Path=TitleVisibility}" |
51 |
| - FontSize="{StaticResource FlyoutHeaderFontSize}" |
52 |
| - Margin="15,0,0,0" |
53 |
| - VerticalAlignment="Center" /> |
54 |
| - </DockPanel> |
| 11 | + <wpf:ColorZone |
| 12 | + Mode="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mahApps:FlyoutAssist.HeaderColorMode)}" |
| 13 | + wpf:ShadowAssist.ShadowDepth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mahApps:FlyoutAssist.HeaderShadowDepth)}"> |
| 14 | + <DockPanel x:Name="dpHeader" |
| 15 | + Margin="10,25,10,10" |
| 16 | + VerticalAlignment="Center" |
| 17 | + LastChildFill="True"> |
| 18 | + <Button x:Name="nav" |
| 19 | + Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type Controls:Flyout}}, Path=CloseCommand, Mode=OneWay}" |
| 20 | + DockPanel.Dock="Left" |
| 21 | + Style="{DynamicResource MaterialDesignToolButton}" |
| 22 | + Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:Flyout}}, Path=CloseButtonVisibility}" |
| 23 | + Height="40" |
| 24 | + Width="40" |
| 25 | + FontSize="16" |
| 26 | + VerticalAlignment="Bottom"> |
| 27 | + <i:Interaction.Triggers> |
| 28 | + <i:EventTrigger EventName="Click"> |
| 29 | + <Actions:SetFlyoutOpenAction TargetObject="{Binding RelativeSource={RelativeSource AncestorType={x:Type Controls:Flyout}}}" |
| 30 | + Value="False" /> |
| 31 | + </i:EventTrigger> |
| 32 | + </i:Interaction.Triggers> |
| 33 | + <Viewbox Width="24" Height="24" RenderTransformOrigin="0.5,0.5"> |
| 34 | + <Viewbox.RenderTransform> |
| 35 | + <TransformGroup> |
| 36 | + <ScaleTransform ScaleY="1" ScaleX="-1"/> |
| 37 | + <SkewTransform AngleY="0" AngleX="0"/> |
| 38 | + <RotateTransform Angle="0"/> |
| 39 | + <TranslateTransform/> |
| 40 | + </TransformGroup> |
| 41 | + </Viewbox.RenderTransform> |
| 42 | + <Canvas Width="24" Height="24"> |
| 43 | + <Path Data="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" |
| 44 | + Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:ColorZone}, Path=Foreground}" /> |
| 45 | + </Canvas> |
| 46 | + </Viewbox> |
| 47 | + </Button> |
| 48 | + <TextBlock Text="{Binding}" |
| 49 | + x:Name="PART_BackButton" |
| 50 | + Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:Flyout}}, Path=TitleVisibility}" |
| 51 | + FontSize="{StaticResource FlyoutHeaderFontSize}" |
| 52 | + Margin="15,0,0,0" |
| 53 | + VerticalAlignment="Center" /> |
| 54 | + </DockPanel> |
| 55 | + </wpf:ColorZone> |
55 | 56 | <DataTemplate.Triggers>
|
56 | 57 | <DataTrigger Binding="{Binding Position, RelativeSource={RelativeSource AncestorType={x:Type Controls:Flyout}}}"
|
57 | 58 | Value="Left">
|
|
258 | 259 | Value="Stretch" />
|
259 | 260 | <Setter Property="VerticalContentAlignment"
|
260 | 261 | Value="Stretch" />
|
| 262 | + <Setter Property="mahApps:FlyoutAssist.HeaderShadowDepth" |
| 263 | + Value="Depth2" /> |
| 264 | + <Setter Property="mahApps:FlyoutAssist.HeaderColorMode" |
| 265 | + Value="PrimaryMid" /> |
261 | 266 | <Setter Property="HeaderTemplate"
|
262 | 267 | Value="{StaticResource HeaderTemplate}" />
|
263 | 268 | <Setter Property="Template"
|
|
267 | 272 | <Setter Property="Foreground"
|
268 | 273 | Value="{DynamicResource MaterialDesignBody}" />
|
269 | 274 | <Setter Property="Background"
|
270 |
| - Value="{DynamicResource MaterialDesignPaper}" /> |
| 275 | + Value="{DynamicResource MaterialDesignPaper}" /> |
| 276 | + <Style.Triggers> |
| 277 | + <Trigger Property="TitleVisibility" Value="Collapsed"> |
| 278 | + <Setter Property="mahApps:FlyoutAssist.HeaderShadowDepth" Value="Depth0" /> |
| 279 | + <Setter Property="mahApps:FlyoutAssist.HeaderColorMode" Value="Standard" /> |
| 280 | + </Trigger> |
| 281 | + <Trigger Property="TitleVisibility" Value="Hidden"> |
| 282 | + <Setter Property="mahApps:FlyoutAssist.HeaderShadowDepth" Value="Depth0" /> |
| 283 | + <Setter Property="mahApps:FlyoutAssist.HeaderColorMode" Value="Standard" /> |
| 284 | + </Trigger> |
| 285 | + </Style.Triggers> |
271 | 286 | </Style>
|
272 | 287 | </ResourceDictionary>
|
0 commit comments