일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Series
- LSTM
- ipad
- GT-S80
- javascript
- CNN
- pandas
- Lotto
- Python
- pip
- GitHub
- 알고리즘
- E-P1
- Numpy
- mean
- imread
- Splunk
- pycharm
- install
- RNN
- keras
- SciPy
- synology
- mariadb
- Button
- index
- dataframe
- 삼성소프트웨어멤버십
- DFS
- SPL
Archives
- Today
- Total
잠토의 잠망경
[WPF] MVVM Mouse Event 처리 본문
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
<UserControl.Resources>
<ResourceDictionary>
<DataTemplate x:Key="mItemDT">
<Grid>
<Label
Content="{Binding Path=File_Name, UpdateSourceTrigger=PropertyChanged}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<ei:CallMethodAction MethodName="Control_OnMouseDoubleClick" TargetObject="{Binding}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Label>
</Grid>
</DataTemplate>
</ResourceDictionary>
</UserControl.Resources>
<Grid DockPanel.Dock="Top" Height="200">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding ListItems, UpdateSourceTrigger=PropertyChanged}"
ItemTemplate="{StaticResource mItemDT}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</Grid>
<Grid DockPanel.Dock="Top" Height="200">
<DataGrid
SelectedItem="{Binding SelecedItem, UpdateSourceTrigger=PropertyChanged}"
IsReadOnly="True"
ItemsSource="{Binding ListItems, UpdateSourceTrigger=PropertyChanged}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<ei:CallMethodAction MethodName="Control_OnMouseLeftButtonDown" TargetObject="{Binding}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</DataGrid>
</Grid>
// main
public void Control_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
CallbackFunction(SelecedItem);
}
Comments