Skip to content

Commit a28adba

Browse files
committed
Update datepicker placeholder style
1 parent ce4bf45 commit a28adba

File tree

1 file changed

+23
-7
lines changed
  • src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles

1 file changed

+23
-7
lines changed

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/DatePicker.xaml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,32 @@
4747
<Setter.Value>
4848
<ControlTemplate TargetType="{x:Type DatePickerTextBox}">
4949
<Grid>
50-
<Border>
51-
<ContentControl x:Name="PART_Watermark"
52-
Opacity="0"
53-
Focusable="False"
54-
IsHitTestVisible="False"
55-
Padding="2"/>
56-
</Border>
50+
<VisualStateManager.VisualStateGroups>
51+
<VisualStateGroup Name="WatermarkStates">
52+
<VisualStateGroup.Transitions>
53+
<VisualTransition GeneratedDuration="0" />
54+
</VisualStateGroup.Transitions>
55+
<VisualState Name="Unwatermarked" />
56+
<VisualState Name="Watermarked">
57+
<Storyboard>
58+
<DoubleAnimation Storyboard.TargetName="PART_Watermark" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
59+
</Storyboard>
60+
</VisualState>
61+
</VisualStateGroup>
62+
</VisualStateManager.VisualStateGroups>
63+
5764
<Border Margin="{TemplateBinding Margin}">
5865
<Decorator x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" />
5966
</Border>
67+
<Border Margin="{TemplateBinding Margin}">
68+
<!-- This is a placeholder for DatePickerTextBox -->
69+
<ContentControl
70+
x:Name="PART_Watermark"
71+
Opacity="0"
72+
Margin="{TemplateBinding Padding}"
73+
Focusable="False"
74+
IsHitTestVisible="False" />
75+
</Border>
6076
</Grid>
6177
</ControlTemplate>
6278
</Setter.Value>

0 commit comments

Comments
 (0)