/// <summary> /// Applies the filter for the entry. /// </summary> /// <param name="filter">The filter.</param> public override void ApplyFilter(PropertyFilter filter) { var propertiesMatch = false; foreach (var entry in Properties) { if (PropertyMatchesFilter(filter, entry)) propertiesMatch = true; } HasVisibleProperties = _properties.Any(IsVisibleProperty); MatchesFilter = propertiesMatch; if (propertiesMatch && !IsExpanded) IsExpanded = true; OnFilterApplied(filter); }
private static bool PropertyMatchesFilter(PropertyFilter filter, PropertyItem entry) { entry.ApplyFilter(filter); return entry.MatchesFilter; }
/// <summary> /// Applies the filter for the entry. /// </summary> /// <param name="filter">The filter.</param> public abstract void ApplyFilter(PropertyFilter filter);
/// <summary> /// Called when filter was applied for the entry. /// </summary> /// <param name="filter">The filter.</param> protected virtual void OnFilterApplied(PropertyFilter filter) { var handler = FilterApplied; if (handler != null) handler(this, new PropertyFilterAppliedEventArgs(filter)); }
/// <summary> /// Initializes a new instance of the <see cref="PropertyFilterAppliedEventArgs"/> class. /// </summary> /// <param name="filter">The filter.</param> public PropertyFilterAppliedEventArgs(PropertyFilter filter) { Filter = filter; }