开发者

Using IValueConverter For A Bound TextBox

开发者 https://www.devze.com 2023-03-24 03:35 出处:网络
I have a textbox in a ListView: <GridViewColumn> <GridViewColumn.CellTemplate> <DataTemplate>

I have a textbox in a ListView:

<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Password,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</GridViewColumn.C开发者_JAVA百科ellTemplate>
</GridViewColumn>

Can someone give me the code to convert the text to "•" and in-code behind back again to the original text (using IValueConverter or any other method)?


You can use passwordBox control:

<PasswordBox x:Name="txtPassword" />

And if binding is your problem then you can implement an Interface in the View which have a method say "GetCredential()" and in the ViewModel you can get the password value and can do the further Authentication.

0

精彩评论

暂无评论...
验证码 换一张
取 消