在哪里可以找到DatePickerTextBox的ControlTemplate
本文关键字:DatePickerTextBox ControlTemplate 在哪里 | 更新日期: 2023-09-27 18:20:04
有人能给我一个DatePickerTextBox的ControlTemplate吗?
我访问过MSDN。在那里我找不到DatePickerTextBox的ControlTemplate。然而,我找到了DatePicker的ControlTemplate。我刚刚发现DatePickerTextBox有两个不同的部分,即:PART_Watermark和PART_ContentElement。但是我找不到DatePickerTextBox的ControlTemplate。
下面是DatePickerTextBox
的默认模板:
<ControlTemplate TargetType="DatePickerTextBox">
<Grid>
<Grid.Resources>
<SolidColorBrush
x:Key="G">#FFAAAAAA</SolidColorBrush>
</Grid.Resources>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup
Name="CommonStates" />
<VisualStateGroup
Name="WatermarkStates" />
<VisualStateGroup
Name="FocusStates" />
</VisualStateManager.VisualStateGroups>
<Border
BorderThickness="{TemplateBinding Border.BorderThickness}"
Padding="{TemplateBinding Control.Padding}"
CornerRadius="1,1,1,1"
BorderBrush="{TemplateBinding Border.BorderBrush}"
Background="{TemplateBinding Panel.Background}"
Name="Border"
Opacity="1">
<Grid
Name="WatermarkContent"
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}">
<Border
BorderThickness="1,1,1,1"
BorderBrush="#FFFFFFFF"
Name="ContentElement" />
<Border
BorderThickness="1,1,1,1"
BorderBrush="#FFFFFFFF"
Name="watermark_decorator">
<ContentControl
Padding="2,2,2,2"
Name="PART_Watermark"
Opacity="0"
IsHitTestVisible="False"
Focusable="False" />
</Border>
<ScrollViewer
HorizontalContentAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding Control.VerticalContentAlignment}"
Name="PART_ContentHost"
Margin="0,0,0,0" />
<Border
CornerRadius="1,1,1,1"
BorderBrush="#FF45D6FA"
Name="FocusVisual"
Opacity="0"
IsHitTestVisible="False" />
</Grid>
</Border>
</Grid>
</ControlTemplate>