WPF TextBlock에 Password 바인딩하기
조회수 1494회
<Style x:Key="RPasswordBox" TargetType="{x:Type PasswordBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type PasswordBox}">
<Grid Background="Transparent">
<Rectangle x:Name="background" Fill="White" Opacity="0.6"
Stroke="Gray" StrokeThickness="1" RadiusX="7" RadiusY="7">
</Rectangle>
<TextBlock Text="{TemplateBinding Password}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="background" Property="Opacity" Value="0.7"/>
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="background" Property="Opacity" Value="1"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
이렇게 작성해 보았지만 패스워드박스의 패스워드는 바인딩을 할 수 없더군요. 패스워드박스의 스타일링하는법을 몰라서 저렇게 하고있다만, 해결방안을 아시는분은 도움을 주시길 바래요 ㅠㅠ
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력