Resources/XAML/ResourceDictionaries/PasswordBox.xaml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style x:Key="CustomPasswordBoxStyle" TargetType="{x:Type PasswordBox}"> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type PasswordBox}"> <Border CornerRadius="10" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <ScrollViewer x:Name="PART_ContentHost" Margin="0"/> </Border> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="Effect"> <Setter.Value> <DropShadowEffect ShadowDepth="0" Direction="0" Color="#FFF485F0" Opacity="1" BlurRadius="10" RenderingBias="Quality"/> </Setter.Value> </Setter> <Style.Triggers> <!-- Trigger to apply blur when the PasswordBox is disabled --> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Effect"> <Setter.Value> <BlurEffect Radius="5"/> </Setter.Value> </Setter> <!-- Reducing the opacity to further indicate that the PasswordBox is disabled --> <Setter Property="Opacity" Value="0.7"/> </Trigger> </Style.Triggers> </Style> </ResourceDictionary> |