我正在爲Windows Phone 7構建一個應用程序,我需要搜索框。在點擊搜索框時,它應該顯示web服務中已存在的城市名稱。我不知道如何繼續。請幫助我的Windows Phone 7應用程序中的搜索框
1
A
回答
1
我想你需要的是AutoCompleteBox在WP工具,使用它像這樣: 只是數據源綁定到AutoCompleteBox並設置ItemFilter
XAML:
<toolkit:AutoCompleteBox x:Name="peopleBox" Height="70"/>
代碼:
this.peopleBox.ItemsSource = myDataSource;
this.peopleBox.ItemFilter += SearchCountry;
SearchCountry是:
bool SearchCountry(string search, object value)
{
if (value != null)
{
//return true if it contains the search key
if (value.ToString().ToLower().IndexOf(search) >= 0)
return true;
}
// if not, return false
return false;
}
相關問題
- 1. 添加在我的Windows手機搜索框7應用程序
- 2. Windows Phone 7應用程序
- 3. windows phone 7應用程序
- 4. windows phone 7語音搜索
- 5. Windows Phone 7上的Flex應用程序
- 6. 在windows phone 7應用程序的文本框中佔位
- 7. 僅適用於Windows Phone 7的Windows Phone應用程序?
- 8. 不能在我的Windows Phone 7應用程序中使用WriteableBitmapEX
- 9. Windows Phone 8上的Windows Phone 7應用程序8
- 10. Windows Phone 7的搜索按鈕
- 11. 我如何在Windows Phone 7上測試我的應用程序
- 12. 在Windows Phone 7中搜索功能?
- 13. 使用Facebook用戶登錄我的Windows Phone 7應用程序
- 14. 貝寶在Windows Phone 7應用程序
- 15. 測試Windows Phone 7應用程序
- 16. 規劃Windows Phone 7應用程序
- 17. 國際化Windows Phone 7應用程序
- 18. 保護Windows Phone 7應用程序?
- 19. Windows Phone 7應用程序問題
- 20. 爲Windows Phone 7開發應用程序
- 21. Windows Phone 7隱藏應用程序欄
- 22. 應用程序欄| Windows phone 7
- 23. 部署Windows Phone 7應用程序
- 24. Windows Phone 7應用程序 - INPC問題
- 25. Windows Phone 7關閉應用程序
- 26. Facebook應用程序和Windows Phone 7
- 27. 如何讓我的Windows Phone 7應用程序顯示在Windows Phone 8市場?
- 28. Windows Phone應用程序的搜索功能
- 29. 在Windows Phone商店中搜索時應用程序不可見
- 30. 在Windows Phone中按名稱搜索控件c#應用程序
@ har07嘿,你能給我一些這個想法 – bhaku
你的意思是AutoCompleteBox? –
@ChrisShao Ya autocompletebox。我已經做到了。請參閱我在新問題中發佈的代碼 – bhaku