3
使用this question (Inline editing TextBlock in a ListBox with DataTemplate (WPF)我現在有一個ListBox
可以雙擊來編輯它中的項目。我現在想要的是在窗體上有一個Button
,單擊它時會將一個新項目添加到ListBox
(這很容易),但是然後將ListBoxItem
更改爲editmode,以便用戶可以立即輸入該值。您如何選擇合適的ListBoxItem
,然後在其中找到TextBlock
和TextBox
並使用SelectedIndex
更改它們的可見性?wpf當單擊按鈕時,在列表框中編輯項目