|
2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
3 | 3 | xmlns:mahAppsControls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
|
4 | 4 | xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks">
|
5 |
| - <Style x:Key="ExpanderDownHeader" BasedOn="{StaticResource MahApps.Styles.ToggleButton.ExpanderHeader.Down}" TargetType="{x:Type ToggleButton}"> |
| 5 | + <Style x:Key="ExpanderDownHeader" |
| 6 | + BasedOn="{StaticResource ResourceKey=MahApps.Styles.ToggleButton.ExpanderHeader.Down}" |
| 7 | + TargetType="{x:Type TypeName=ToggleButton}"> |
6 | 8 | <Setter Property="Template">
|
7 | 9 | <Setter.Value>
|
8 |
| - <ControlTemplate TargetType="{x:Type ToggleButton}"> |
9 |
| - <Border Padding="{TemplateBinding Padding}" |
10 |
| - Background="{TemplateBinding Background}" |
11 |
| - BorderBrush="{TemplateBinding BorderBrush}" |
12 |
| - BorderThickness="{TemplateBinding BorderThickness}"> |
| 10 | + <ControlTemplate TargetType="{x:Type TypeName=ToggleButton}"> |
| 11 | + <Border Padding="{TemplateBinding Property=Padding}" |
| 12 | + Background="{TemplateBinding Property=Background}" |
| 13 | + BorderBrush="{TemplateBinding Property=BorderBrush}" |
| 14 | + BorderThickness="{TemplateBinding Property=BorderThickness}"> |
13 | 15 | <Grid Background="Transparent" SnapsToDevicePixels="False">
|
14 | 16 | <Grid.ColumnDefinitions>
|
15 | 17 | <ColumnDefinition Width="Auto" />
|
16 | 18 | <ColumnDefinition Width="*" />
|
17 | 19 | </Grid.ColumnDefinitions>
|
18 |
| - <Rectangle Grid.Column="0" x:Name="Chevron" Width="16" Height="16" Fill="{DynamicResource MahApps.Brushes.Gray3}" VerticalAlignment="Center"> |
| 20 | + <Rectangle Grid.Column="0" Grid.Row="0" |
| 21 | + x:Name="Chevron" |
| 22 | + Width="16" Height="16" |
| 23 | + Fill="{DynamicResource ResourceKey=MahApps.Brushes.Gray3}" |
| 24 | + VerticalAlignment="Center"> |
19 | 25 | <Rectangle.OpacityMask>
|
20 | 26 | <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronUp}" />
|
21 | 27 | </Rectangle.OpacityMask>
|
22 | 28 | </Rectangle>
|
23 | 29 | <mahAppsControls:ContentControlEx Grid.Column="1"
|
24 | 30 | Margin="10,0,0,0"
|
25 | 31 | HorizontalAlignment="Stretch"
|
26 |
| - Padding="{TemplateBinding Padding}" |
27 |
| - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
28 |
| - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
29 |
| - Content="{TemplateBinding Content}" |
30 |
| - ContentCharacterCasing="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mahAppsControls:ControlsHelper.ContentCharacterCasing)}" |
31 |
| - ContentStringFormat="{TemplateBinding ContentStringFormat}" |
32 |
| - ContentTemplate="{TemplateBinding ContentTemplate}" |
33 |
| - ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" |
| 32 | + Padding="{TemplateBinding Property=Padding}" |
| 33 | + HorizontalContentAlignment="{TemplateBinding Property=HorizontalContentAlignment}" |
| 34 | + VerticalContentAlignment="{TemplateBinding Property=VerticalContentAlignment}" |
| 35 | + Content="{TemplateBinding Property=Content}" |
| 36 | + ContentCharacterCasing="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(mahAppsControls:ControlsHelper.ContentCharacterCasing)}" |
| 37 | + ContentStringFormat="{TemplateBinding Property=ContentStringFormat}" |
| 38 | + ContentTemplate="{TemplateBinding Property=ContentTemplate}" |
| 39 | + ContentTemplateSelector="{TemplateBinding Property=ContentTemplateSelector}" |
34 | 40 | RecognizesAccessKey="True"
|
35 |
| - SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"> |
| 41 | + SnapsToDevicePixels="{TemplateBinding Property=SnapsToDevicePixels}"> |
36 | 42 | </mahAppsControls:ContentControlEx>
|
37 | 43 | </Grid>
|
38 | 44 | </Border>
|
|
45 | 51 | </Setter>
|
46 | 52 | </Trigger>
|
47 | 53 | <Trigger Property="IsMouseOver" Value="True">
|
48 |
| - <Setter TargetName="Chevron" Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}"/> |
| 54 | + <Setter TargetName="Chevron" Property="Fill" |
| 55 | + Value="{DynamicResource ResourceKey=MahApps.Brushes.Gray5}"/> |
49 | 56 | </Trigger>
|
50 | 57 | </ControlTemplate.Triggers>
|
51 | 58 | </ControlTemplate>
|
52 | 59 | </Setter.Value>
|
53 | 60 | </Setter>
|
54 | 61 | </Style>
|
55 | 62 |
|
56 |
| - <Style x:Key="DefaultExpander" TargetType="{x:Type Expander}" BasedOn="{StaticResource MahApps.Styles.Expander}"> |
| 63 | + <Style x:Key="DefaultExpander" |
| 64 | + TargetType="{x:Type TypeName=Expander}" |
| 65 | + BasedOn="{StaticResource ResourceKey=MahApps.Styles.Expander}"> |
57 | 66 | <Setter Property="BorderThickness" Value="0" />
|
58 | 67 | <Setter Property="ExpandDirection" Value="Down" />
|
59 | 68 | <Setter Property="Padding" Value="0" />
|
60 |
| - <Setter Property="mahAppsControls:HeaderedControlHelper.HeaderBackground" Value="Transparent" /> |
61 |
| - <Setter Property="mahAppsControls:HeaderedControlHelper.HeaderForeground" Value="{StaticResource MahApps.Brushes.Gray3}" /> |
62 |
| - <Setter Property="mahAppsControls:ControlsHelper.ContentCharacterCasing" Value="Normal" /> |
63 |
| - <Setter Property="mahAppsControls:ExpanderHelper.HeaderDownStyle" Value="{DynamicResource ExpanderDownHeader}" /> |
| 69 | + <Setter Property="mahAppsControls:HeaderedControlHelper.HeaderBackground" |
| 70 | + Value="Transparent" /> |
| 71 | + <Setter Property="mahAppsControls:HeaderedControlHelper.HeaderForeground" |
| 72 | + Value="{StaticResource ResourceKey=MahApps.Brushes.Gray3}" /> |
| 73 | + <Setter Property="mahAppsControls:ControlsHelper.ContentCharacterCasing" |
| 74 | + Value="Normal" /> |
| 75 | + <Setter Property="mahAppsControls:ExpanderHelper.HeaderDownStyle" |
| 76 | + Value="{DynamicResource ResourceKey=ExpanderDownHeader}" /> |
64 | 77 | </Style>
|
65 | 78 |
|
66 |
| - <Style x:Key="ProfileExpanderOpen" BasedOn="{StaticResource MahApps.Styles.ToggleButton.ExpanderHeader.Down}" TargetType="{x:Type ToggleButton}"> |
| 79 | + <Style x:Key="ProfileExpanderOpen" |
| 80 | + BasedOn="{StaticResource ResourceKey=MahApps.Styles.ToggleButton.ExpanderHeader.Down}" |
| 81 | + TargetType="{x:Type TypeName=ToggleButton}"> |
67 | 82 | <Setter Property="Template" Value="{x:Null}" />
|
68 | 83 | </Style>
|
69 | 84 |
|
70 |
| - <Style x:Key="ProfileExpanderClosed" BasedOn="{StaticResource MahApps.Styles.ToggleButton.ExpanderHeader.Right}" TargetType="{x:Type ToggleButton}"> |
| 85 | + <Style x:Key="ProfileExpanderClosed" |
| 86 | + BasedOn="{StaticResource ResourceKey=MahApps.Styles.ToggleButton.ExpanderHeader.Right}" |
| 87 | + TargetType="{x:Type TypeName=ToggleButton}"> |
71 | 88 | <Setter Property="Template">
|
72 | 89 | <Setter.Value>
|
73 |
| - <ControlTemplate TargetType="{x:Type ToggleButton}"> |
74 |
| - <Border Padding="{TemplateBinding Padding}" |
75 |
| - Background="{TemplateBinding Background}" |
76 |
| - BorderBrush="{TemplateBinding BorderBrush}" |
77 |
| - BorderThickness="{TemplateBinding BorderThickness}"> |
| 90 | + <ControlTemplate TargetType="{x:Type TypeName=ToggleButton}"> |
| 91 | + <Border Padding="{TemplateBinding Property=Padding}" |
| 92 | + Background="{TemplateBinding Property=Background}" |
| 93 | + BorderBrush="{TemplateBinding Property=BorderBrush}" |
| 94 | + BorderThickness="{TemplateBinding Property=BorderThickness}"> |
78 | 95 | <Grid Background="Transparent" SnapsToDevicePixels="False">
|
79 | 96 | <Grid.RowDefinitions>
|
80 | 97 | <RowDefinition Height="Auto" />
|
81 | 98 | <RowDefinition Height="*" />
|
82 | 99 | </Grid.RowDefinitions>
|
83 |
| - <Rectangle Grid.Row="0" x:Name="Chevron" Width="16" Height="16" Fill="{DynamicResource MahApps.Brushes.Gray3}" Margin="10,15,10,10" VerticalAlignment="Center" HorizontalAlignment="Center"> |
| 100 | + <Rectangle Grid.Row="0" x:Name="Chevron" |
| 101 | + Width="16" Height="16" |
| 102 | + Fill="{DynamicResource ResourceKey=MahApps.Brushes.Gray3}" Margin="10,15,10,10" |
| 103 | + VerticalAlignment="Center" |
| 104 | + HorizontalAlignment="Center"> |
84 | 105 | <Rectangle.OpacityMask>
|
85 | 106 | <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronLeft}" />
|
86 | 107 | </Rectangle.OpacityMask>
|
87 | 108 | </Rectangle>
|
88 |
| - <TextBlock Grid.Row="1" Text="{TemplateBinding Content}" TextOptions.TextFormattingMode="Display" Foreground="{TemplateBinding Foreground}" Style="{StaticResource DefaultTextBlock}" FontSize="18" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center"> |
| 109 | + <TextBlock Grid.Row="1" |
| 110 | + Text="{TemplateBinding Property=Content}" |
| 111 | + TextOptions.TextFormattingMode="Display" |
| 112 | + Foreground="{TemplateBinding Property=Foreground}" |
| 113 | + Style="{StaticResource ResourceKey=DefaultTextBlock}" |
| 114 | + FontSize="18" |
| 115 | + Margin="0" |
| 116 | + VerticalAlignment="Center" |
| 117 | + HorizontalAlignment="Center"> |
89 | 118 | <TextBlock.LayoutTransform>
|
90 | 119 | <RotateTransform Angle="-90" />
|
91 | 120 | </TextBlock.LayoutTransform>
|
|
94 | 123 | </Border>
|
95 | 124 | <ControlTemplate.Triggers>
|
96 | 125 | <Trigger Property="IsMouseOver" Value="True">
|
97 |
| - <Setter TargetName="Chevron" Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}"/> |
| 126 | + <Setter TargetName="Chevron" Property="Fill" |
| 127 | + Value="{DynamicResource ResourceKey=MahApps.Brushes.Gray5}"/> |
98 | 128 | </Trigger>
|
99 | 129 | </ControlTemplate.Triggers>
|
100 | 130 | </ControlTemplate>
|
101 | 131 | </Setter.Value>
|
102 | 132 | </Setter>
|
103 | 133 | </Style>
|
104 | 134 |
|
105 |
| - <Style x:Key="ProfileExpander" TargetType="{x:Type Expander}" BasedOn="{StaticResource MahApps.Styles.Expander}"> |
| 135 | + <Style x:Key="ProfileExpander" |
| 136 | + TargetType="{x:Type TypeName=Expander}" |
| 137 | + BasedOn="{StaticResource ResourceKey=MahApps.Styles.Expander}"> |
106 | 138 | <Setter Property="BorderThickness" Value="0" />
|
107 | 139 | <Setter Property="ExpandDirection" Value="Right" />
|
108 | 140 | <Setter Property="Padding" Value="10" />
|
109 |
| - <Setter Property="mahAppsControls:HeaderedControlHelper.HeaderBackground" Value="Transparent" /> |
110 |
| - <Setter Property="mahAppsControls:HeaderedControlHelper.HeaderForeground" Value="{StaticResource MahApps.Brushes.Gray3}" /> |
111 |
| - <Setter Property="mahAppsControls:ControlsHelper.ContentCharacterCasing" Value="Normal" /> |
112 |
| - <Setter Property="mahAppsControls:ExpanderHelper.HeaderRightStyle" Value="{DynamicResource ProfileExpanderClosed}" /> |
| 141 | + <Setter Property="mahAppsControls:HeaderedControlHelper.HeaderBackground" |
| 142 | + Value="Transparent" /> |
| 143 | + <Setter Property="mahAppsControls:HeaderedControlHelper.HeaderForeground" |
| 144 | + Value="{StaticResource ResourceKey=MahApps.Brushes.Gray3}" /> |
| 145 | + <Setter Property="mahAppsControls:ControlsHelper.ContentCharacterCasing" |
| 146 | + Value="Normal" /> |
| 147 | + <Setter Property="mahAppsControls:ExpanderHelper.HeaderRightStyle" |
| 148 | + Value="{DynamicResource ResourceKey=ProfileExpanderClosed}" /> |
113 | 149 | <Style.Triggers>
|
114 | 150 | <Trigger Property="IsExpanded" Value="True">
|
115 | 151 | <Setter Property="ExpandDirection" Value="Down" />
|
116 |
| - <Setter Property="mahAppsControls:ExpanderHelper.HeaderDownStyle" Value="{DynamicResource ProfileExpanderOpen}" /> |
| 152 | + <Setter Property="mahAppsControls:ExpanderHelper.HeaderDownStyle" |
| 153 | + Value="{DynamicResource ResourceKey=ProfileExpanderOpen}" /> |
117 | 154 | </Trigger>
|
118 | 155 | </Style.Triggers>
|
119 | 156 | </Style>
|
|
0 commit comments