2012-04-11 29 views

回答

1

数据透视项目的重点在于克服放置在数据透视项目内的任何控件。

<controls:PivotItem Header="item1"> 
       <i:Interaction.Triggers> 
        <i:EventTrigger EventName="GotFocus"> 
         <i:InvokeCommandAction Command="{Binding ShowMessageCommand}" /> 
        </i:EventTrigger> 
       </i:Interaction.Triggers> 
       <Grid> 
        <TextBox Height="100" 
          Width="200"/> 
        <Button Height="100" 
          Width="200" /> 
       </Grid> 
      </controls:PivotItem> 

此代码适用于我。点击按钮或文本框时,数据透视项目会集中注意力。 希望这可以帮助你。

+0

,这是工作,但我必须点击透视Cotrol内部有什么直接点击Pivot Control的Header或者我们可以使用鼠标移动旋转控制,然后它会被触发。谢谢。! – 2012-04-21 11:57:56

+0

你的要求是什么? – TutuGeorge 2012-04-22 07:22:16

0

是,

给你的解决方案:

<controls:Pivot Title="My Pivot"> 
<i:Interaction.Triggers> 
    <i:EventTrigger EventName="SelectionChanged"> 
     <i:InvokeCommandAction Command="{Binding EuropePivotSelectedCommand}" /> 
    </i:EventTrigger> 
</i:Interaction.Triggers> 

<controls:PivotItem Header="item1"> 
</controls:PivotItem> 

<controls:PivotItem Header="item2"> 
</controls:PivotItem> 

问候 Juanlu,ElGuerre