Created
June 14, 2013 15:54
-
-
Save rtanote/5782973 to your computer and use it in GitHub Desktop.
Livetを使ったListViewのRoutedEvent処理(ListViewItemのダブルクリックを捕捉してActionを起動する)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ↓ コードビハインド | |
<ListView> | |
<ListView.View> | |
<!-- リスト --> | |
</ListView.View> | |
<ListView.ItemContainerStyle> | |
<Style TargetType="{x:Type ListViewItem}"> | |
<EventSetter Event="MouseDoubleClick" Handler="ListViewItem_MouseDoubleClick"/> | |
</Style> | |
</ListView.ItemContainerStyle> | |
</ListView> | |
// ↓ LivetのRoutedEventTriggerを使って任意のアクションを実行 | |
<!-- | |
xmlns:l="http://schemas.livet-mvvm.net/2011/wpf" | |
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" | |
--> | |
<ListView> | |
<ListView.View> | |
<!-- リスト --> | |
</ListView.View> | |
<i:Interaction.Triggers> | |
<l:RoutedEventTrigger RoutedEvent="ListViewItem.MouseDoubleClick"> | |
<!-- action --> | |
</l:RoutedEventTrigger> | |
</i:Interaction.Triggers> | |
</ListView> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment