繼續聊WPF——如何獲取ListView中選中的項
阿新 • • 發佈:2019-02-19
- <Grid>
- <ListView x:Name="lv" SelectionChanged="lv_SelectionChanged">
- <ListView.View>
- <GridView AllowsColumnReorder="True">
- <GridViewColumn DisplayMemberBinding="{Binding Path=Name}" Header="姓名"
- Width="65"/>
- <GridViewColumn DisplayMemberBinding="{Binding Path=Age}" Header="年齡"
- Width="65"/>
- <GridViewColumn DisplayMemberBinding="{Binding Path=City}" Header="所在城市"
- Width="70"/>
- </GridView>
- </ListView.View>
- </ListView>
- </Grid>