WPF ListBox(ListView) 自定义 Button 项,获取 ListBox(ListView)的SelectedValue

private void Button1_Click(object sender, RoutedEventArgs e) { var curItem = ((ListBoxItem)lvQueue.ContainerFromElement((Button)sender)).Content; DataRowView drv = curItem as DataRowView; MessageBox.Show(drv[0].ToString()); }
原文地址:https://www.cnblogs.com/dinid/p/2182920.html