如何将MaxLength应用于watermarkControl:C#中的WatermarkPasswordBox?

时间:2012-09-16 19:22:03

标签: c# xaml windows-phone maxlength

所以,我可以使用你的帮助将MaxLength =“10”应用于此watermarkpasswordbox

<watermarkControls:WatermarkPasswordBox  
    x:Name="passwordLoginTextBox"  
    WatermarkText="{Binding Path=LocalizedResources.PasswordWatermark, 
                            Source={StaticResource LocalizedStrings}}" />

1 个答案:

答案 0 :(得分:0)

只需在代码隐藏文件中添加以下内容:

passwordLoginTextBox.MaxLength = 10;