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>

이렇게 작성해 보았지만 패스워드박스의 패스워드는 바인딩을 할 수 없더군요. 패스워드박스의 스타일링하는법을 몰라서 저렇게 하고있다만, 해결방안을 아시는분은 도움을 주시길 바래요 ㅠㅠ

  • (•́ ✖ •̀)
    알 수 없는 사용자

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)