示例#1
0
        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);
            }
        }
示例#2
0
        private ResourcesSearchFilter GetSearchFilterFromFragmentQS(Dictionary <string, string> fragmentQS)
        {
            ResourcesSearchFilter filter = new ResourcesSearchFilter();

            if (fragmentQS.Keys.Contains("Keyword"))
            {
                filter.Keyword = fragmentQS["Keyword"];
            }

            return(filter);
        }
示例#3
0
 public void GetMaterialeDifinitionsForClassSearch(int?classID, ResourcesSearchFilter filter, Action <IEnumerable <ResourceDefinition> > callback)
 {
     this.LoadQuery <ResourceDefinition>(this.Context.GetMaterialDefinitionsForClassSearchQuery(classID, filter.Keyword), callback);
 }
示例#4
0
        private ResourcesSearchFilter GetSearchFilterFromFragmentQS(Dictionary<string, string> fragmentQS)
        {
            ResourcesSearchFilter filter = new ResourcesSearchFilter();

            if (fragmentQS.Keys.Contains("Keyword"))
                filter.Keyword = fragmentQS["Keyword"];

            return filter;
        }
示例#5
0
 public void GetMaterialeDifinitionsForClassSearch(int? classID,ResourcesSearchFilter filter, Action<IEnumerable<ResourceDefinition>> callback)
 {
     this.LoadQuery<ResourceDefinition>(this.Context.GetMaterialDefinitionsForClassSearchQuery(classID, filter.Keyword), callback);
 }