How to pass two parameters from XAML, one Type object and one Model {Binding}
, to ViewModel as CommandParameter. I came across different posts on SO but all are using control bindings. Is there any way to pass Type instead.
I want something like this:
<MenuItem x:Key="RuleBase" Header="RuleBase" x:Shared="False"
Command="{Binding DataContext.AddRuleCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}">
<MenuItem.CommandParameter>
<MultiBinding Converter="{StaticResource MultiParameterConverter}">
<Binding Path="{Binding}" />
<Binding Path="{x:Type local:RuleBase}" />
</MultiBinding>
</MenuItem.CommandParameter>
</MenuItem>
This piece of code is working with one parameter alone:
<MenuItem x:Key="RuleBase" Header="RuleBase" x:Shared="False"
Command="{Binding DataContext.AddRuleCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
CommandParameter="{x:Type local:RuleBase}" />