我尝试将 CommandParameter 从简单绑定传递到 MultiBinding,但在下面的多绑定示例中找不到“{Binding}”的语法。非常感谢任何提示!
问候,法比亚努斯
<Button Content="Add subevent" HorizontalAlignment="Left" MinWidth="100" Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.AddEvent}" CommandParameter="{Binding}" />
带有 MultiBinding 的 CommandParameter:
<Button Content="Add subevent" HorizontalAlignment="Left" MinWidth="100" Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.AddEvent}" >
<Button.CommandParameter>
<MultiBinding Converter="{StaticResource searchFilterConverter}">
<Binding Path="" />
<Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType=Window}" Path="DataContext.SelectedProduct" />
</MultiBinding>
</Button.CommandParameter>
</Button>