Hi,
I'm working with the Telerik RadPasswordBox
and I'm currently using the Windows 11 theme along with the NoXAML DLL in a WPF project. However, I am unable to apply a dark background color to the RadPasswordBox
when it's hovered over or clicked.
Here’s what I’m trying to achieve:
- Hover Effect: When the user hovers over the
RadPasswordBox
, I want the background to change to a dark color. - Click Effect: Similarly, when the
RadPasswordBox
is clicked, the background should remain dark until the focus is lost.
I have tried setting the Background
property in the relevant triggers, but it does not seem to work as expected. Could anyone provide guidance or a solution on how to implement this with the Windows 11 theme and NoXAML DLL?
Thank you for your help!
below is my code
<telerik:RadPasswordBox
x:Name="ClientIdTextBox"
Grid.Column="1"
Width="600"
BorderThickness="0"
FontSize="20"
Foreground="#A7A3DC"
Style="{StaticResource CustomPasswordBoxStyle}"
WatermarkContent="ClientID">
<telerik:RadPasswordBox.WatermarkTemplate>
<DataTemplate>
<TextBlock
Foreground="#A7A3DC"
Opacity="0.7"
Text="{Binding}" />
</DataTemplate>
</telerik:RadPasswordBox.WatermarkTemplate>
</telerik:RadPasswordBox>
<Style x:Key="CustomPasswordBoxStyle" TargetType="telerik:RadPasswordBox">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="#A7A3DC" />
<Setter Property="FontSize" Value="20" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#080812" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background" Value="#080812" />
</Trigger>
</Style.Triggers>
</Style>