我需要在按钮样式中绑定一个命令,我尝试使用以下代码,但它无法正常工作
<<table_symbionts_chunk, results="asis", echo=FALSE>>=
library(xtable)
irisX <-print (xtable (iris,
digits=rep(0,6),
align= c("p{0.015\\textwidth}|",
"p{0.37\\textwidth}|",
"p{0.12\\textwidth}|",
"p{0.08\\textwidth}|",
"p{0.02\\textwidth}|",
"p{0.35\\textwidth}|")))
@
视图模型:
<Style x:Key="Button_ML" TargetType="Button">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Command" Value="{Binding DataContext.ButtonClickCommand,RelativeSource={RelativeSource Mode=Self},ElementName=grdSearch}"/>
<Setter Property="CommandParameter" Value="{Binding Content, RelativeSource={RelativeSource Self}}">
</Style>