I'm finding the WPF command parameters to be a limitation. Perhaps that's a sign that I'm using them for the wrong purpose, but I'm still giving it a try before I scrap and take a different tack.
I put together a system for executing commands asynchronously, but it's hard to use anything that requires data input. I know one common pattern with WPF commands is to pass in this
. But this
will not work at all for asynchronous commands because all the dependency properties are then inaccessible.
I end up with code like 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>
and also need the InstallServiceParametersConverter class (plus InstallServiceParameters).
Anyone see an obvious way to improve upon this?