EditorExtensions
Extension methods for DevExpress editors and related helpers used across WPF UI.
方法
AddClearButton(ButtonEdit, Func<object>)
Adds a clear (reset) button to the specified editor. When clicked, it sets the editor's EditValueProperty to the value returned by .
- edit
- The editor to extend.
- getEmptyValue
- Factory that returns a value to assign on clear. If null, null will be assigned.
AddClearButton(ComboBoxEditSettings, object)
Adds a clear (reset) button to the specified ComboBoxEditSettings. When clicked, it sets the owning editor's value to .
- editSettings
- The combo box editor settings to extend.
- emptyValue
- The value to assign on clear. Defaults to null.
GetSelecteds``1(ComboBoxEditEx)
Gets the currently selected values as IEnumerable.
- cb
- The combo box to read from.
返回值: A sequence of selected values.
GetSelected``1(ComboBoxEditEx)
Gets the currently selected value cast to .
- cb
- The combo box to read from.
返回值: The current value cast to .
RemoveClearButton(ButtonEdit)
Removes a previously added clear (reset) button from the specified editor, if present.
- edit
- The editor to modify.
SetItemsSource(ComboBoxEditEx, Type)
Sets the items source of the combo box to all values of the specified .
- cb
- The combo box to populate.
- enumType
- The enum type to use as items.
SetItemsSource(ComboBoxEditEx, IItemsSource)
Assigns the specified IItemsSource to the combo box.
- cb
- The combo box to modify.
- source
- The items source to assign.
SetItemsSource``1(ComboBoxEditEx)
Sets the items source of the combo box to all values of the specified enum type .
- cb
- The combo box to populate.
SetItemsSource``1(ComboBoxEditEx, IEnumerable<T>, Func<T, string>, Func<T, string>)
Sets the items source of the combo box to the provided values.
- cb
- The combo box to populate.
- values
- The values to show.
- getName
- Optional display name resolver.
- getDescription
- Optional description resolver.
SetSelected``1(ComboBoxEditEx, T)
Sets the current value of the combo box.
- cb
- The combo box to modify.
- value
- The value to set.
ToItemsSource(object, Type, bool?, ListSortDirection?, Func<IItemsSourceItem, bool>, Func<object, string>, Func<object, string>) : IItemsSource
Converts the specified value to an IItemsSource using the provided item type and optional filters.
- val
- The source value to wrap.
- itemValueType
- Type of values contained in the items source.
- excludeObsolete
- Whether to exclude obsolete items. If null, the default behavior is used.
- sortOrder
- Optional sort direction.
- filter
- Optional filter applied to items.
- getName
- Optional display name resolver.
- getDescription
- Optional description resolver.
返回值: An IItemsSource instance.
ToItemsSource``1(IEnumerable<T>, bool, ListSortDirection?, Func<IItemsSourceItem, bool>, Func<T, string>, Func<T, string>)
Wraps the specified sequence into an IItemsSource with optional filtering and sorting.
- val
- Source sequence.
- excludeObsolete
- Whether to exclude obsolete items. Default is true.
- sortOrder
- Optional sort direction.
- filter
- Optional filter predicate.
- getName
- Optional display name resolver.
- getDescription
- Optional description resolver.
返回值: An IItemsSource instance.