0

SecureStringWPF アプリケーションでは、パラメーターとして aを受け入れるログイン コマンドがありました。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 を使用してパラメーターをイベント ハンドラーに渡すことはできますか?

4

1 に答える 1

0

UWP アプリはマルチバインドをサポートしていないため、xbind でイベント ハンドラーを渡すことはできません。Bind は強い型付けされたオブジェクト用であり、それを行うには別の方法を見つける必要があります。

UWP では、WPF でコントロールの Password プロパティに直接バインドすることはできません。

このような:

   <PasswordBox
                    Margin="0,12,0,0"
                    Header="Contraseña"
                    Password="{Binding Password, Mode=TwoWay}"
                    PasswordRevealMode="Peek"
                    PlaceholderText="Escribe tu contraseña" />

よろしくお願いします

于 2017-02-17T05:01:56.517 に答える