0
A
回答
4
在一個新的數據綁定應用程序,改變了下面的方法看看3種方式得到這個的:
// Handle selection changed on ListBox
private void MainListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// If selected index is -1 (no selection) do nothing
if (MainListBox.SelectedIndex == -1)
return;
var string1 = ((sender as ListBox).SelectedItem as ItemViewModel).LineOne;
var string2 = (MainListBox.SelectedItem as ItemViewModel).LineOne;
var string3 = (e.AddedItems[0] as ItemViewModel).LineOne;
// Navigate to the new page
NavigationService.Navigate(new Uri("/DetailsPage.xaml?selectedItem=" + MainListBox.SelectedIndex, UriKind.Relative));
// Reset selected index to -1 (no selection)
MainListBox.SelectedIndex = -1;
}
相關問題
- 1. 列表框項目isEnabled WP7
- 2. 如何獲取WP7的長列表選擇器中的項目的文本框
- 3. 獲取列表框值WP7
- 4. WP7在列表框中獲取可見項目
- 5. WP7 - 如何從ViewModel獲取列表框項目?
- 6. 獲取列表項到MultiLine文本框
- 7. 單擊列表框項目更改WP7
- 8. WP7 VB.NET墓碑列表框項目
- 9. WP7:造型列表框項目
- 10. 如何從列表框項目獲取文本?
- 11. 獲取列表框項目Silverlight
- 12. 從列表框項目獲取值
- 13. WPF列表框獲取項目datacontext OnMouseOver
- 14. 如何從列表框中獲取列表框項目wpf
- 15. 如何獲取WP7內容項目中的資產列表?
- 16. 獲取WP7地名列表
- 17. WP7 - 文本菜單列表框項單擊事件
- 18. 從WP7獲取文本ClipBoard
- 19. ASP.NET列表框選擇的項目改變文本框文本
- 20. 文本框文本到列表框項目vb.net
- 21. 獲取列表項目GUID
- 22. 獲取列表項目數
- 23. Appium獲取列表項目
- 24. 提取列表框的文本塊綁定到字符串wp7
- 25. jQuery從列表項中獲取文本
- 26. WP7 - 在列表框中訪問選擇項目時列表框是一個ItemTemplate
- 27. Powershell列表框項目項目文本的不同值?
- 28. 使用jQuery通過Value獲取列表框中的項目文本
- 29. 獲取下拉列表選項的值顯示爲文本框
- 30. 從點擊列表視圖項目獲取文本
那麼字符串包含的文本? – Al3xhamilton
'string1','sdtring2'和'string3'每個都包含文本。 –
對不起,有這麼多的問題,但是它知道什麼線路,我可以使用3種方式中的任何一種? – Al3xhamilton