我需要一些关于Search Content Win 8 App的帮助 [英] I need some help about Search Content Win 8 App
本文介绍了我需要一些关于Search Content Win 8 App的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将搜索添加到声明中。我从新项目添加搜索合同。但是我运行程序,点击搜索(在魅力上),插入一些单词并按回车键。但是我输入的这个词并没有进入QueryText。我如何解决这个问题?我的项目已接近完成,但我无法进行搜索。
I add Search to Declarations. And I add search contract from new item. But I run the program, click search(on charms), insert some word and press enter. But the word which is I entered isn't come in to QueryText. How I Solve this? My project is nearly finish but I cant do this "search".
public sealed partial class SearchResultsMainPage : TurkiyeIftarVakitleri.Common.LayoutAwarePage
{
public SearchResultsMainPage()
{
this.InitializeComponent();
}
protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
{
var queryText = navigationParameter as String;
var filterList = new List<Filter>();
filterList.Add(new Filter("All", 0, true));
this.DefaultViewModel["QueryText"] = '\u201c' + queryText + '\u201d';
this.DefaultViewModel["Filters"] = filterList;
this.DefaultViewModel["ShowFilters"] = filterList.Count > 1;
}
void Filter_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// Determine what filter was selected
var selectedFilter = e.AddedItems.FirstOrDefault() as Filter;
if (selectedFilter != null)
{
// Mirror the results into the corresponding Filter object to allow the
// RadioButton representation used when not snapped to reflect the change
selectedFilter.Active = true;
// TODO: Respond to the change in active filter by setting this.DefaultViewModel["Results"]
// to a collection of items with bindable Image, Title, Subtitle, and Description properties
// Ensure results are found
object results;
ICollection resultsCollection;
if (this.DefaultViewModel.TryGetValue("Results", out results) &&
(resultsCollection = results as ICollection) != null &&
resultsCollection.Count != 0)
{
VisualStateManager.GoToState(this, "ResultsFound", true);
return;
}
}
// Display informational text when there are no search results.
VisualStateManager.GoToState(this, "NoResultsFound", true);
}
void Filter_Checked(object sender, RoutedEventArgs e)
{
// Mirror the change into the CollectionViewSource used by the corresponding ComboBox
// to ensure that the change is reflected when snapped
if (filtersViewSource.View != null)
{
var filter = (sender as FrameworkElement).DataContext;
filtersViewSource.View.MoveCurrentTo(filter);
}
}
推荐答案
我想这个样品会帮到你
http://code.msdn.microsoft.com/windowsapps/Search-app -contract-sample-118a92f5 [ ^ ]
谢谢,
Bilaal
I think this samples will help you
http://code.msdn.microsoft.com/windowsapps/Search-app-contract-sample-118a92f5[^]
Thanks,
Bilaal
这篇关于我需要一些关于Search Content Win 8 App的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文