public void FragmentNavigation(string fragment) { Dictionary <string, string> fragmentQS = GetFragmentQueryString(fragment); CurrentResourceClass = GetClassFromFragmentQS(fragmentQS); int?_resourceClassID = CurrentResourceClass == null ? null : CurrentResourceClass.ResourceClassID as int?; SearchFilter = GetSearchFilterFromFragmentQS(fragmentQS); Action <IEnumerable <ResourceDefinition> > handler = (mds) => { //should be done on ui thread // do we need to wrapped them in observable collection or in viewmodel ResourceDefinitions = mds.ToList(); IsMBusy = false; NotifyOfPropertyChange("ResourceDefinitions"); }; IsMBusy = true; if (SearchFilter.Keyword != null) { _materialRepository.GetMaterialeDifinitionsForClassSearch(_resourceClassID, SearchFilter, handler); } else { _materialRepository.GetMaterialeDifinitionsForClass(_resourceClassID, handler); } }
private ResourcesSearchFilter GetSearchFilterFromFragmentQS(Dictionary <string, string> fragmentQS) { ResourcesSearchFilter filter = new ResourcesSearchFilter(); if (fragmentQS.Keys.Contains("Keyword")) { filter.Keyword = fragmentQS["Keyword"]; } return(filter); }
public void GetMaterialeDifinitionsForClassSearch(int?classID, ResourcesSearchFilter filter, Action <IEnumerable <ResourceDefinition> > callback) { this.LoadQuery <ResourceDefinition>(this.Context.GetMaterialDefinitionsForClassSearchQuery(classID, filter.Keyword), callback); }
private ResourcesSearchFilter GetSearchFilterFromFragmentQS(Dictionary<string, string> fragmentQS) { ResourcesSearchFilter filter = new ResourcesSearchFilter(); if (fragmentQS.Keys.Contains("Keyword")) filter.Keyword = fragmentQS["Keyword"]; return filter; }
public void GetMaterialeDifinitionsForClassSearch(int? classID,ResourcesSearchFilter filter, Action<IEnumerable<ResourceDefinition>> callback) { this.LoadQuery<ResourceDefinition>(this.Context.GetMaterialDefinitionsForClassSearchQuery(classID, filter.Keyword), callback); }