0

TextBoxXAML をXAMLに変換する必要がありPasswordBoxます。主な問題は <TextBox.Text>.

どのようにそれを行うことができますか?

ありがとうございました!

<TextBox Grid.Column="1" Grid.Row="1" Height="23" HorizontalAlignment="Left" Name="tbxPassword" VerticalAlignment="Top" Width="277">
 <TextBox.Text>
     <Binding Path="Password" Source="{StaticResource ods}"  UpdateSourceTrigger="PropertyChanged" >
      <Binding.ValidationRules>
            <c:ConfigValidationRule />
      </Binding.ValidationRules>
     </Binding>
 </TextBox.Text>
</TextBox>
4

1 に答える 1

4

それが本当にパスワードに関するものである場合は、PasswordBox を使用する必要があります。それを依存関係プロパティにバインドすると、セキュリティの脆弱性が発生します。

<PasswordBox
 Name="pwdBox" 
 MaxLength="64"
 PasswordChar="#"
 PasswordChanged="PasswordChangedHandler"  
/>

基本的な使い方はこちら パスワードボックス

于 2012-08-06T19:35:26.823 に答える