Accueil > Non classé > Enum filter controls

Enum filter controls

For having a CheckBox selection for enum type like this

and make easy filter on collection

you can use this two components

  • EnumFilterControl
  • EnumFilterComboControl

EnumFilterControl

Is base control for showing enum in grid

EnumFilterComboControl

Is the same control but using ComboBox

Extra code

Styles

Common properties

Properties Descriptions Default
Title Title for control (show at left) Filter
ShowHiddenEnum Define if you must show item of enum with ExcludeFilterAttribute false

if you have an enum with (usage of attribues)

in this case when ShowHiddenEnum=true, you can show None and All

And if you use HideFilterColorAttribute on enum like this

Force to hide color even ShowColor=true

Properties Descriptions Default
ItemConverter For specify class can convert Items (IValueConverter) for color indicator and text translation or try to use TypeConverter null

TypeConverter if define, like this

usage like this

or use a TypeConverter like this

for TypeConverter the converting is automatic

Properties Descriptions Default
ShowColor define if rectangle color is visible and ItemsConverter is define for color (not return null) or TypeConverter exist and can convert to Brush true
ShowAll Show All CheckBox true
ShowNone Show None CheckBox true
AllText Text for All CheckBox true
NoneText Text for None CheckBox true
Selector Is the selectedItems for this component with

  • null if all selected
  • object[] empty if none selected
  • object[] contains enum element checked
null
AllowAll do not use, is used for disable all checkbox
AllowNone do not use, is used for disable none checkbox
All do not use, is used for check all checkbox
None do not use, is used for checknone checkbox
CheckWith for specify size of CheckBox if you want 80D
Type Is the type of enum you want to show null

Usage

in xaml

for filtering

Categories: Non classé Tags:
  1. Pas encore de commentaire
  1. Pas encore de trackbacks