上两篇文章中说双击行获取不到当前数据对象问题,

http://www.cnblogs.com/ligl/p/5636899.html

http://www.cnblogs.com/ligl/p/5629802.html

后来又研究发现可以从MouseButtonEventArgs参数中获取到

  <ListBox Grid.Row="1" ItemsSource="{Binding DataList}" 
                 MouseDoubleClick="ListBox_MouseDoubleClick"
                 SelectedItem="{Binding CurrentSelectItem}" Background="AliceBlue">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <DockPanel Height="50"  Background="DarkGray" Width="300">
                        <TextBox Text="{Binding Name}"  Height="30" Width="200" Background="DimGray"></TextBox>
                    </DockPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
View Code

相关文章: