예제 #1
0
        // Another Blend work-around - we expose all properties through the OM, not just the
        // Browsable ones.  However, as a result, we need to cull the non-browsable ones from
        // consideration.  Otherwise, empty categories may appear.
        protected override bool DoesPropertyMatchFilter(PropertyFilter filter, PropertyEntry property)
        {
            property.ApplyFilter(filter);

            bool isBrowsable = true;
            ModelPropertyEntry modelPropertyEntry = property as ModelPropertyEntry;

            if (modelPropertyEntry != null)
            {
                //display given property if it is browsable or
                isBrowsable = modelPropertyEntry.IsBrowsable ||
                              // it may not be browsable, but if there is a category editor associated - display it anyway
                              (this.CategoryEditors != null && this.CategoryEditors.Count != 0);
            }

            return(isBrowsable && property.MatchesFilter);
        }