Exemple #1
0
 /// <summary>
 /// Used to raise the IPropertyFilterTarget FilterApplied event
 /// </summary>
 /// <param name="filter"></param>
 protected virtual void OnFilterApplied(PropertyFilter filter)
 {
     if (FilterApplied != null)
     {
         FilterApplied(this, new PropertyFilterAppliedEventArgs(filter));
     }
 }
 /// <summary>
 /// Creates a new PropertyFilterAppliedEventArgs
 /// </summary>
 /// <param name="filter">The PropertyFilter that was applied.</param>
 public PropertyFilterAppliedEventArgs(PropertyFilter filter)
 {
     _filter = filter;
 }
        // 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;
        }
        // <summary>
        // This is a work-around fix because Blend's CategoryBase does not handle null filters (valid value)
        // correctly.  We need to ask Blend to eventually fix this issue.
        // </summary>
        // <param name="filter">Filter to apply, can be null</param>
        public override void ApplyFilter(PropertyFilter filter) 
        {
            if (filter == null) 
            {
                this.MatchesFilter = true;
                this.BasicPropertyMatchesFilter = true;
                this.AdvancedPropertyMatchesFilter = true;

                foreach (PropertyEntry property in this.BasicProperties)
                {
                    property.ApplyFilter(filter);
                }

                foreach (PropertyEntry property in this.AdvancedProperties)
                {
                    property.ApplyFilter(filter);
                }
            }
            else 
            {
                base.ApplyFilter(filter);
            }
        }
 /// <summary>
 /// IPropertyFilterTarget method
 /// </summary>
 /// <param name="filter"></param>
 public virtual void ApplyFilter(PropertyFilter filter) {
     this.MatchesFilter = filter == null ? true : filter.Match(this);
     OnFilterApplied(filter);
 }
 /// <summary>
 /// Raises the IPropertyFilterTarget.FilterApplied event
 /// </summary>
 /// <param name="filter">The PropertyFilter being applied</param>
 protected virtual void OnFilterApplied(PropertyFilter filter) {
     if (FilterApplied != null) {
         FilterApplied(this, new PropertyFilterAppliedEventArgs(filter));
     }
 }
Exemple #7
0
 /// <summary>
 /// IPropertyFilterTarget method
 /// </summary>
 /// <param name="filter">the PropertyFilter to apply</param>
 public virtual void ApplyFilter(PropertyFilter filter)
 {
     this.MatchesFilter = filter == null ? true : filter.Match(this);
     OnFilterApplied(filter);
 }
 /// <summary>
 /// Creates a new PropertyFilterAppliedEventArgs
 /// </summary>
 /// <param name="filter">The PropertyFilter that was applied.</param>
 public PropertyFilterAppliedEventArgs(PropertyFilter filter)
 {
     _filter = filter;
 }