2017-02-15 18 views
0

當UWP在父網格上設置Tapped事件時,子複選框會自動檢查爲雙擊。uwp複選框double Tapped

我想檢查孩子複選框爲Tapped而不是雙重Tapped

謝謝您的回覆。

<Grid Background="Black" > 
    <interactivity:Interaction.Behaviors> 
    <core:EventTriggerBehavior EventName="Tapped"> 
     <core:InvokeCommandAction Command="{Binding DataContext.SelectDefectImageCommand, ElementName=PART_ItemList}" CommandParameter="{Binding}" /> 
    </core:EventTriggerBehavior> 
    </interactivity:Interaction.Behaviors> 

    <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Style="{StaticResource WhiteCheckBoxStyle}" VerticalAlignment="Center" Margin="5,0,0,0" /> 

</Grid> 
+0

你是什麼意思雙擊?你的意思是Tapped事件被觸發兩次? – mindOfAi

+0

雙擊是雙擊 – ceastgun

回答

0

我想你想要的設置GridTapped事件中的選中狀態,但結果被重寫,因爲CheckBox檢查也觸發。您可以通過將CheckBoxIsHitTestVisible屬性設置爲false來防止這種情況,在這種情況下,該複選框不會生成指針事件,因此會忽略該水龍頭。

+0

謝謝你的回覆。 – ceastgun