我有一个DataTemplate,它表示通过自定义AppBarCommand对象集合声明的AppBar按钮。
public AppBarCommand(RelayCommand command, string buttonstyle)
{
Command = command;
ButtonStyle = buttonstyle;
}
<DataTemplate>
<Button Command="{Binding Command}"
Style="{Binding ButtonStyle, Converter={StaticResource StringNameToStyleConverter}}"/>
</DataTemplate>
我想添加一个CommandParameter绑定,但参数必须是按钮本身。这样我就可以设置Callisto飞出菜单的PlacementTarget。这是否可能?