[英]Pass parameter to xbind event handler
在WPF应用程序中,我有一个登录命令,该命令接受SecureString
作为参数。 我使用了xaml转换器将值从密码框传递到命令。
<PasswordBox
Name="PasswordBox"
Grid.Row="2"
Grid.Column="2" />
<Button
Grid.Row="3"
Grid.Column="3"
Command="{Binding LoginCommand}"
Content="{x:Static p:Resources.LoginView_LoginButtonContent}">
<Button.CommandParameter>
<MultiBinding
Converter="{c:PasswordBoxConverter}"
Mode="TwoWay"
UpdateSourceTrigger="PropertyChanged">
<Binding ElementName="PasswordBox" />
</MultiBinding>
</Button.CommandParameter>
</Button>
我想使用xbind在UWP中做类似的事情。 您可以使用xbind将参数传递给事件处理程序吗?
UWP应用程序不支持多重绑定,并且您不能通过xbind传递事件处理程序。 绑定是针对强类型对象的,您将需要找到另一种方法。
使用UWP,您可以直接绑定到WPF中控件的Password属性。
像这样:
<PasswordBox
Margin="0,12,0,0"
Header="Contraseña"
Password="{Binding Password, Mode=TwoWay}"
PasswordRevealMode="Peek"
PlaceholderText="Escribe tu contraseña" />
最好的祝福
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.