我有CustomTextBox
控件它附带Place HolderText。
控件的样式就像这样
<Style TargetType="{x:Type controls:WaterMarkTextBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:WaterMarkTextBox}">
<Grid x:Name="PART_GridControl"
Height="{TemplateBinding Height}"
Width="{TemplateBinding Width}">
<TextBlock x:Name="PART_PlaceHolderTextBlock"
VerticalAlignment="Center"
Margin="20,0,10,0"/>
<TextBox x:Name="PART_PlaceHolderTextBox"
Background="Transparent"
VerticalContentAlignment="Center"
FontSize="{TemplateBinding FontSize}"
FontFamily="{TemplateBinding FontFamily}"
FontWeight="{TemplateBinding FontWeight}"
Padding="20,0,150,0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
但是当我按下标签时,它不会聚焦。请帮我解决这个问题。提前致谢。