Command可以根据CommandParameter传参
也可以这样绑定
<Label Grid.Row="0">姓名:</Label> <TextBox Name="name" Grid.Row="0" Grid.Column="1" Text="{Binding Person.Name}"></TextBox> <Label Grid.Row="1">年龄:</Label> <TextBox Name="age" Grid.Row="1" Grid.Column="1" Text="{Binding Person.Age}"></TextBox> <Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Command="{Binding SubmitCommand}" CommandParameter="{Binding Person}" Content="提交参数"></Button>https://github.com/zLulus/NotePractice/tree/dev3/WPF/WpfDemo/Command
Command用于后台操作,click用于前台展示、交互,可以共存
转载于:https://www.cnblogs.com/Lulus/p/9726379.html