WPF ListBox获取选中的值

        private void DG1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBoxItem item = new ListBoxItem
            {
                Content = (DG1.SelectedItem as DataRowView).Row["SQL"].ToString(),
            };
            ListBox_Result.Items.Add(item);
        }

你可能感兴趣的:(WPF ListBox获取选中的值)