private void OnSelectedFilterCategoryChanged(FilterCategoryId categoryName)
        {
            Pici.Log.info(typeof(FilterChooserViewModel),
                          string.Format("selected filter category {0}", Chooser.SelectedFilterCategory));
            var category = HBS.Search.FilterList.FirstOrDefault(fc => fc.Id == categoryName);

            if (category != null)
            {
                if (category.Id == FilterCategoryId.date)
                {
                    Filter = new DateFilterVM(category);
                    //Filter = new ListFilterViewModel(category);
                }
                else if (category.Id == FilterCategoryId.available)
                {
                    Filter = new AvailableFilterViewModel(category);
                    FiltersApplied(this, Filter.SelectedFilter);
                }
                else
                {
                    Filter = new ListFilterViewModel(category);
                }
            }
            else
            {
                if (categoryName == FilterCategoryId.digital)
                {
                    Filter = new DigitalFilterVM();
                    FiltersApplied(this, Filter.SelectedFilter);
                }
            }
        }
示例#2
0
        public static string GetName(FilterCategoryId category, string valueId)
        {
            FilterDictionaryEntry dict;

            if (DICT.TryGetValue(category, out dict))
            {
                string res;
                if (dict.Values != null && dict.Values.TryGetValue(valueId, out res))
                {
                    return(res);
                }
            }
            return(valueId);
        }
示例#3
0
 protected virtual void OnCategoryNameEnumChanged(FilterCategoryId category)
 {
     Name = Pici.Resources.Find(category.ToString());
 }
示例#4
0
 public ChooserButtonViewModel(FilterCategoryId filterCategory, ViewStyle style)
 {
     CategoryName = filterCategory;
     Init(style);
 }