1
1
<ResourceDictionary xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml" >
2
2
3
- <Style x : Key =" MetroCalendarDayButtonStyle" TargetType =" {x:Type CalendarDayButton}" >
4
- <Setter Property =" FontFamily" Value =" {DynamicResource ContentFontFamily }" />
5
- <Setter Property =" FontSize" Value =" {DynamicResource ContentFontSize }" />
3
+ <Style x : Key =" MahApps.Metro.Styles. MetroCalendarDayButtonStyle" TargetType =" {x:Type CalendarDayButton}" >
4
+ <Setter Property =" FontFamily" Value =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}, Path=FontFamily, Mode=OneWay }" />
5
+ <Setter Property =" FontSize" Value =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}, Path=FontSize, Mode=OneWay }" />
6
6
<Setter Property =" HorizontalContentAlignment" Value =" Center" />
7
7
<Setter Property =" MinHeight" Value =" 5" />
8
8
<Setter Property =" MinWidth" Value =" 5" />
144
144
<Setter Property =" VerticalContentAlignment" Value =" Center" />
145
145
</Style >
146
146
147
- <Style x : Key =" MetroCalendarItemStyle" TargetType =" {x:Type CalendarItem}" >
147
+ <!-- obsolete -->
148
+ <Style x : Key =" MetroCalendarDayButtonStyle"
149
+ BasedOn =" {StaticResource MahApps.Metro.Styles.MetroCalendarDayButtonStyle}"
150
+ TargetType =" {x:Type CalendarDayButton}" />
151
+
152
+ <Style x : Key =" MahApps.Metro.Styles.MetroCalendarItemStyle" TargetType =" {x:Type CalendarItem}" >
148
153
<Setter Property =" Margin" Value =" 0 3" />
149
154
<Setter Property =" Padding" Value =" 2" />
150
155
<Setter Property =" SnapsToDevicePixels" Value =" True" />
157
162
<TextBlock Margin =" 0 6 0 6"
158
163
HorizontalAlignment =" Center"
159
164
VerticalAlignment =" Center"
160
- FontFamily =" {DynamicResource ContentFontFamily}"
161
- FontSize =" {DynamicResource ContentFontSize}"
162
165
FontWeight =" Bold"
163
166
Foreground =" {DynamicResource BlackBrush}"
164
167
Opacity =" 0.8"
184
187
<Path x : Name =" path"
185
188
Width =" 6"
186
189
Height =" 10"
187
- Margin =" 14,-6,0, 0"
190
+ Margin =" 14 -6 0 0"
188
191
HorizontalAlignment =" Left"
189
192
VerticalAlignment =" Center"
190
193
Data =" M288.75,232.25 L288.75,240.625 L283,236.625 z"
222
225
<Path x : Name =" path"
223
226
Width =" 6"
224
227
Height =" 10"
225
- Margin =" 0,-6,14, 0"
228
+ Margin =" 0 -6 14 0"
226
229
HorizontalAlignment =" Right"
227
230
VerticalAlignment =" Center"
228
231
Data =" M282.875,231.875 L282.875,240.375 L288.625,236 z"
255
258
<ControlTemplate x : Key =" HeaderButtonTemplate" TargetType =" {x:Type Button}" >
256
259
<Grid Cursor =" Hand" >
257
260
<ContentPresenter x : Name =" buttonContent"
258
- Margin =" 1,4,1, 9"
261
+ Margin =" 1 4 1 9"
259
262
HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}"
260
263
VerticalAlignment =" {TemplateBinding VerticalContentAlignment}"
261
264
Content =" {TemplateBinding Content}"
262
265
ContentTemplate =" {TemplateBinding ContentTemplate}"
263
- Opacity =" 0.7"
264
- TextElement.FontFamily=" {DynamicResource ContentFontFamily}"
265
- TextElement.Foreground=" {DynamicResource AccentSelectedColorBrush}" />
266
+ Opacity =" 0.7" />
266
267
<VisualStateManager .VisualStateGroups>
267
268
<VisualStateGroup x : Name =" CommonStates" >
268
269
<VisualState x : Name =" Normal" />
314
315
HorizontalAlignment =" Center"
315
316
VerticalAlignment =" Center"
316
317
Focusable =" False"
317
- FontFamily =" {DynamicResource ContentFontFamily}"
318
- FontSize =" {DynamicResource ContentFontSize}"
319
318
FontWeight =" Bold"
320
319
Style =" {StaticResource HeaderCalendarButtonStyle}" />
321
320
<Button x : Name =" PART_PreviousButton"
417
416
</Setter >
418
417
</Style >
419
418
419
+ <!-- obsolete -->
420
+ <Style x : Key =" MetroCalendarItemStyle"
421
+ BasedOn =" {StaticResource MahApps.Metro.Styles.MetroCalendarItemStyle}"
422
+ TargetType =" {x:Type CalendarItem}" />
423
+
420
424
<!-- Style for Month and Year buttons -->
421
- <Style x : Key =" MetroCalendarButtonStyle" TargetType =" {x:Type CalendarButton}" >
425
+ <Style x : Key =" MahApps.Metro.Styles. MetroCalendarButtonStyle" TargetType =" {x:Type CalendarButton}" >
422
426
<Setter Property =" Background" Value =" {DynamicResource AccentColorBrush4}" />
423
- <Setter Property =" FontFamily" Value =" {DynamicResource ContentFontFamily }" />
424
- <Setter Property =" FontSize" Value =" {DynamicResource ContentFontSize }" />
427
+ <Setter Property =" FontFamily" Value =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}, Path=FontFamily, Mode=OneWay }" />
428
+ <Setter Property =" FontSize" Value =" {Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}, Path=FontSize, Mode=OneWay }" />
425
429
<Setter Property =" HorizontalContentAlignment" Value =" Center" />
426
430
<Setter Property =" MinHeight" Value =" 42" />
427
431
<Setter Property =" MinWidth" Value =" 40" />
541
545
<Setter Property =" VerticalContentAlignment" Value =" Center" />
542
546
</Style >
543
547
544
- <Style x : Key =" MetroCalendar" TargetType =" {x:Type Calendar}" >
548
+ <!-- obsolete -->
549
+ <Style x : Key =" MetroCalendarButtonStyle"
550
+ BasedOn =" {StaticResource MahApps.Metro.Styles.MetroCalendarButtonStyle}"
551
+ TargetType =" {x:Type CalendarButton}" />
552
+
553
+ <Style x : Key =" MahApps.Metro.Styles.BaseMetroCalendar" TargetType =" {x:Type Calendar}" >
545
554
<Setter Property =" Background" Value =" {DynamicResource WhiteBrush}" />
546
555
<Setter Property =" BorderBrush" Value =" {DynamicResource BlackBrush}" />
547
556
<Setter Property =" BorderThickness" Value =" 1" />
548
- <Setter Property =" CalendarButtonStyle" Value =" {DynamicResource MetroCalendarButtonStyle}" />
549
- <Setter Property =" CalendarDayButtonStyle" Value =" {DynamicResource MetroCalendarDayButtonStyle}" />
550
- <Setter Property =" CalendarItemStyle" Value =" {DynamicResource MetroCalendarItemStyle}" />
557
+ <Setter Property =" CalendarButtonStyle" Value =" {DynamicResource MahApps.Metro.Styles. MetroCalendarButtonStyle}" />
558
+ <Setter Property =" CalendarDayButtonStyle" Value =" {DynamicResource MahApps.Metro.Styles. MetroCalendarDayButtonStyle}" />
559
+ <Setter Property =" CalendarItemStyle" Value =" {DynamicResource MahApps.Metro.Styles. MetroCalendarItemStyle}" />
551
560
<Setter Property =" Foreground" Value =" {DynamicResource TextBrush}" />
552
561
<Setter Property =" HorizontalContentAlignment" Value =" Left" />
553
562
<Setter Property =" SnapsToDevicePixels" Value =" True" />
568
577
</Setter .Value>
569
578
</Setter >
570
579
</Style >
580
+
581
+ <Style x : Key =" MahApps.Metro.Styles.MetroCalendar"
582
+ BasedOn =" {StaticResource MahApps.Metro.Styles.BaseMetroCalendar}"
583
+ TargetType =" {x:Type Calendar}" >
584
+ <Setter Property =" FontFamily" Value =" {DynamicResource ContentFontFamily}" />
585
+ <Setter Property =" FontSize" Value =" {DynamicResource ContentFontSize}" />
586
+ </Style >
587
+
588
+ <!-- obsolete -->
589
+ <Style x : Key =" MetroCalendar"
590
+ BasedOn =" {StaticResource MahApps.Metro.Styles.MetroCalendar}"
591
+ TargetType =" {x:Type Calendar}" />
571
592
</ResourceDictionary >
0 commit comments