WPF コマンド パラメーターが制限であることがわかりました。おそらくそれは、私がそれらを間違った目的で使用している兆候かもしれませんが、廃棄して別の方法をとる前に、まだ試しています.
コマンドを非同期で実行する仕組みを作ったのですが、データ入力が必要なものは使いづらいです。WPF コマンドの一般的なパターンの 1 つは、this. ただしthis、すべての依存関係プロパティにアクセスできないため、非同期コマンドではまったく機能しません。
私は次のようなコードになります:
<Button Command="{Binding ElementName=servicePage, Path=InstallServiceCommand}">
<Button.CommandParameter>
<MultiBinding Converter="{StaticResource InstallServiceParameterConverter}">
<MultiBinding.Bindings>
<Binding ElementName="servicePage" Path="IsInstalled"/>
<Binding ElementName="localURI" Path="Text"/>
<Binding ElementName="meshURI" Path="Text"/>
<Binding ElementName="registerWithMesh" Path="IsChecked"/>
</MultiBinding.Bindings>
</MultiBinding>
</Button.CommandParameter>
</Button>
また、InstallServiceParametersConverter クラス (および InstallServiceParameters) も必要です。
これを改善する明白な方法を見た人はいますか?