如何在WP8中绑定样式内的命令?

时间:2015-10-19 07:24:01

标签: wpf xaml windows-phone-8 data-binding binding

我需要在按钮样式中绑定一个命令,我尝试使用以下代码,但它无法正常工作

<<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>

0 个答案:

没有答案
相关问题