|
46 | 46 | <Setter Property="Template"> |
47 | 47 | <Setter.Value> |
48 | 48 | <ControlTemplate TargetType="{x:Type DatePickerTextBox}"> |
49 | | - <Border Margin="{TemplateBinding Margin}"> |
50 | | - <Decorator x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" /> |
51 | | - </Border> |
| 49 | + <Grid> |
| 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 | + |
| 64 | + <Border Margin="{TemplateBinding Margin}"> |
| 65 | + <Decorator x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" /> |
| 66 | + </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> |
| 76 | + </Grid> |
52 | 77 | </ControlTemplate> |
53 | 78 | </Setter.Value> |
54 | 79 | </Setter> |
|
104 | 129 | BorderBrush="{TemplateBinding BorderBrush}" |
105 | 130 | BorderThickness="{TemplateBinding BorderThickness}" |
106 | 131 | CornerRadius="{TemplateBinding Border.CornerRadius}"> |
107 | | - <Grid FocusManager.FocusedElement="{Binding ElementName=PART_Button}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> |
| 132 | + <Grid x:Name="PART_Root" FocusManager.FocusedElement="{Binding ElementName=PART_Button}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> |
108 | 133 | <Grid.ColumnDefinitions> |
109 | 134 | <ColumnDefinition Width="*" /> |
110 | 135 | <ColumnDefinition Width="Auto" /> |
|
0 commit comments