I have a button with a bound command and command parameter:
<Button Margin="5,0,5,5" Style="{StaticResource MainButton}" Grid.Row="2" Grid.RowSpan="2" Grid.Column="3" Padding="0">
<Button.CommandParameter>
<MultiBinding Converter="{StaticResource SwapArgsConverter}" ConverterParameter="-1">
<Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=tlq:SmartWarningsWindow}" Path="DataContext.SelectedWarning"></Binding>
<Binding Path="Rank"></Binding>
</MultiBinding>
</Button.CommandParameter>
<Button.Command>
<Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=tlq:SmartWarningsWindow}" Path="DataContext.SwapCommand"></Binding>
</Button.Command>
</Button>
The bindings all work fine, but the Command binding resolves, and the ICommand.CanExecute method fires before the CommandParameter binding resolves. This is causing my control to be incorrectly disabled when the window loads.
I have tried several things, including placing the Command Binding after the CommandParameter binding like you see above (originally the command binding was an attribute).
Does anyone know a way to force the CommandParameter binding to resolve first?