每当我尝试将样式应用于文本框时,它都会对用户输入无响应。你能告诉我解决这个问题的方法吗?这是我正在使用的 xaml 代码:
<Style x:Key="textbox"
TargetType="TextBox">
<Setter Property="OverridesDefaultStyle"
Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border BorderThickness="3"
Background="{TemplateBinding Background}"
Name="border">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter TargetName="border"
Property="BorderBrush"
Value="#9E5971" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>