Class SelectionOverlay
class that provides a representation of a list in an overlay. Can be used for a data grid to hide/show/replace columns. see DataGrid style
Inheritance
Implements
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
[TemplatePart(Name = "PART_EditableTextBox", Type = typeof(TextBox))]
[TemplatePart(Name = "PART_Popup", Type = typeof(Popup))]
[TemplatePart(Name = "PART_HeaderPanel", Type = typeof(Panel))]
[SuppressMessage("ReSharper", "LocalizableElement")]
public class SelectionOverlay : ComboBox, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IContainItemStorage, IAddChild
Fields
View SourceAlwaysUseMaxHeightProperty
The always use max height property
Declaration
public static readonly DependencyProperty AlwaysUseMaxHeightProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
AutoCloseDelayProperty
The auto close delay property
Declaration
public static readonly DependencyProperty AutoCloseDelayProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
CloseButtonStyleProperty
The close button style property
Declaration
public static readonly DependencyProperty CloseButtonStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
CloseButtonToolTipProperty
Defines the dependency property of the CloseButtonToolTip property.
Declaration
public static readonly DependencyProperty CloseButtonToolTipProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
CloseButtonVisibilityProperty
The close button visibility property
Declaration
public static readonly DependencyProperty CloseButtonVisibilityProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
CloseOverlayCommandProperty
The close overlay command property
Declaration
public static readonly DependencyProperty CloseOverlayCommandProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
DisableSelectedItemsProperty
The disable selected items property, default is FALSE
Declaration
public static readonly DependencyProperty DisableSelectedItemsProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
DisplayPropertyProperty
The display property property, defining to which path the default item template's content should bind.
Declaration
public static readonly DependencyProperty DisplayPropertyProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
HeaderTextBlockStyleProperty
The header text block style property
Declaration
public static readonly DependencyProperty HeaderTextBlockStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
HeaderTextProperty
The header text property
Declaration
public static readonly DependencyProperty HeaderTextProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
IsDropDownOpenProperty
The is drop down open property
Declaration
public static readonly DependencyProperty IsDropDownOpenProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ItemIsCheckedPropertyConverterProperty
The item is checked property converter property
Declaration
public static readonly DependencyProperty ItemIsCheckedPropertyConverterProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ItemIsCheckedPropertyProperty
The item is checked property path property
Declaration
public static readonly DependencyProperty ItemIsCheckedPropertyProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ItemTypeProperty
The item type property
Declaration
public static readonly DependencyProperty ItemTypeProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ItemsSourceProperty
The is item source property
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
MaxNoOfSelectedItemsProperty
The max no of selected items property
Declaration
public static readonly DependencyProperty MaxNoOfSelectedItemsProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
MinNoOfSelectedItemsProperty
The minimum number of selected items property
Declaration
public static readonly DependencyProperty MinNoOfSelectedItemsProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
NoSearchResultFoundTextProperty
The text to be shown if search reveals no results
Declaration
public static readonly DependencyProperty NoSearchResultFoundTextProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
NoSearchResultFoundTextVisibilityProperty
Sets visibility of text to be shown if search reveals no results
Declaration
public static readonly DependencyProperty NoSearchResultFoundTextVisibilityProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PlacementTargetBackgroundIfDropDownIsOpenProperty
The background property for PlacementTarget if the DropDown of the SelectionOverlay is open
Declaration
public static readonly DependencyProperty PlacementTargetBackgroundIfDropDownIsOpenProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PlacementTargetForegroundIfDropDownIsOpenProperty
The foreground property for PlacementTarget if the DropDown of the SelectionOverlay is open
Declaration
public static readonly DependencyProperty PlacementTargetForegroundIfDropDownIsOpenProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PlacementTargetProperty
The placement target property
Declaration
public static readonly DependencyProperty PlacementTargetProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PopupBackgroundProperty
The popup background property
Declaration
public static readonly DependencyProperty PopupBackgroundProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PopupHeightProperty
The popup height property
Declaration
public static readonly DependencyProperty PopupHeightProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PopupStyleProperty
The popup style property
Declaration
public static readonly DependencyProperty PopupStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
SearchTextBoxVisibilityProperty
The search text box visibility property
Declaration
public static readonly DependencyProperty SearchTextBoxVisibilityProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
SearchTextProperty
The search text property
Declaration
public static readonly DependencyProperty SearchTextProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
SearchTextWatermarkProperty
The search text watermark property
Declaration
public static readonly DependencyProperty SearchTextWatermarkProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
SelectedItemsProperty
The selected items property
Declaration
public static readonly DependencyProperty SelectedItemsProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
StaysOpenProperty
The stays open property, if true, the overlay stays open after selection of an item, otherwise it closes. default: true
Declaration
public static readonly DependencyProperty StaysOpenProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
View SourceAutoCloseDelay
Gets or sets the auto close delay in seconds.
Declaration
public double AutoCloseDelay { get; set; }
Property Value
| Type | Description |
|---|---|
| double | The auto close delay in seconds. |
CloseButtonStyle
Gets or sets the close button style.
Declaration
public Style CloseButtonStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style | The close button style. |
CloseButtonToolTip
Gets or sets the close button tooltip.
Declaration
public string CloseButtonToolTip { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The close button tooltip. |
CloseButtonVisibility
Gets or sets the close button visibility.
Declaration
public Visibility CloseButtonVisibility { get; set; }
Property Value
| Type | Description |
|---|---|
| Visibility | The close button visibility. |
CloseOverlayCommand
Gets or sets the close overlay command.
Declaration
public ICommand CloseOverlayCommand { get; }
Property Value
| Type | Description |
|---|---|
| ICommand | The close overlay command. |
DisableSelectedItems
Determines whether selected items are disabled, default is FALSE.
Declaration
public bool DisableSelectedItems { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | Determines whether selected items are disabled, default is FALSE. |
DisplayProperty
Gets or sets the display property path.
Declaration
public string DisplayProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The display property path. |
HeaderText
Gets or sets the label.
Declaration
public string HeaderText { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The label. |
HeaderTextBlockStyle
Gets or sets the header button style.
Declaration
public Style HeaderTextBlockStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style | The header button style. |
ItemIsCheckedProperty
Gets or sets the item is checked property path.
Declaration
public string ItemIsCheckedProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The item is checked property path. |
ItemIsCheckedPropertyConverter
Gets or sets the item is checked property converter.
Declaration
public IValueConverter ItemIsCheckedPropertyConverter { get; set; }
Property Value
| Type | Description |
|---|---|
| IValueConverter | The item is checked property converter. |
ItemType
Gets or sets the type of the item.
Declaration
public Type ItemType { get; set; }
Property Value
| Type | Description |
|---|---|
| Type | The type of the item. |
ItemsDisplayOrder
gets or sets the ItemsDisplayOrder of the items shown in the SelectionOverlay
Declaration
public ItemsDisplayOrderType? ItemsDisplayOrder { get; set; }
Property Value
| Type | Description |
|---|---|
| ItemsDisplayOrderType? |
MaxNoOfSelectedItems
Gets or sets the maximum number of selected items.
Declaration
public int? MaxNoOfSelectedItems { get; set; }
Property Value
| Type | Description |
|---|---|
| int? | The maximum number of selected items. |
MinNoOfSelectedItems
Gets or sets the minimum number of selected items.
Declaration
public int MinNoOfSelectedItems { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The minimum number of selected items. |
NoSearchResultFoundText
Gets or sets the text to be shown for no search results.
Declaration
public string NoSearchResultFoundText { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The NoSearchResult text. |
NoSearchResultFoundTextVisibility
internal use to define the visibility of the NoSearchResultFound test
Declaration
public Visibility NoSearchResultFoundTextVisibility { get; set; }
Property Value
| Type | Description |
|---|---|
| Visibility |
OpeningOverlayEventName
Gets or sets the auto close delay in seconds.
Declaration
public string OpeningOverlayEventName { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The auto close delay in seconds. |
PartPopup
the popup part of the selection overlay
Declaration
public Popup PartPopup { get; }
Property Value
| Type | Description |
|---|---|
| Popup |
PlacementTarget
Gets or sets the placement target, which the overlay aligns to.
Declaration
public FrameworkElement PlacementTarget { get; set; }
Property Value
| Type | Description |
|---|---|
| FrameworkElement | The placement target. |
PlacementTargetBackgroundIfDropDownIsOpen
gets or sets the background color of the placement target id dropDownIsOpen = true
Declaration
public Brush PlacementTargetBackgroundIfDropDownIsOpen { get; set; }
Property Value
| Type | Description |
|---|---|
| Brush |
PlacementTargetForegroundIfDropDownIsOpen
gets or sets the foreground color of the placement target id dropDownIsOpen = true
Declaration
public Brush PlacementTargetForegroundIfDropDownIsOpen { get; set; }
Property Value
| Type | Description |
|---|---|
| Brush |
PopupBackground
Gets or sets the popup background (default value is SAF_BG_S03).
Declaration
public Color PopupBackground { get; set; }
Property Value
| Type | Description |
|---|---|
| Color | The popup background (default value is SAF_BG_S03). |
PopupHeight
Gets or sets the height of the popup.
Declaration
public double PopupHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
PopupStyle
Gets or sets the popup style.
Declaration
public Style PopupStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style | The popup style. |
SearchText
Gets or sets the search text.
Declaration
public string SearchText { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The search text. |
SearchTextBoxVisibility
Gets or sets the search text box visibility.
Declaration
public Visibility SearchTextBoxVisibility { get; set; }
Property Value
| Type | Description |
|---|---|
| Visibility | The search text box visibility. |
SearchTextWatermark
Gets or sets the search text watermark.
Declaration
public string SearchTextWatermark { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The search text watermark. |
SelectedItems
Gets or sets the selected items.
Declaration
[SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "Is/can be used as dependency property in Xaml.")]
public IList SelectedItems { get; set; }
Property Value
| Type | Description |
|---|---|
| IList | The selected items. |
SortDescriptionSet
defines whether the SelectionOverlay already defines a SortDescription because of the way it is called: null: user specified (default) with replace functionality (attached properties) = true with selection functionality (attached properties) = false
Declaration
public bool? SortDescriptionSet { get; }
Property Value
| Type | Description |
|---|---|
| bool? |
StaysOpen
Gets or sets a value indicating whether the overlay stays open after selection.
Declaration
public bool StaysOpen { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Methods
View SourceClearContainerForItemOverride(DependencyObject, object)
Clears the items before removes
Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| object | item |
Overrides
View SourceGetCloseButtonVisibility(DependencyObject)
Defines the dependency property CloseButtonVisibility. default FALSE
Declaration
public static Visibility GetCloseButtonVisibility(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| Visibility |
GetContainerForItemOverride()
Creates or identifies the element used to display the specified item.
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
| Type | Description |
|---|---|
| DependencyObject | A ComboBoxItem. |
Overrides
View SourceGetDisableSelectedItems(DependencyObject)
Defines the dependency property GetDisableSelected. default FALSE
Declaration
public static bool GetDisableSelectedItems(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| bool |
GetDisplayProperty(DependencyObject)
Defines the dependency property DisplayProperty; Default = "Header" (for the bound itemsSource is of type DataGridColumns)
Declaration
public static string GetDisplayProperty(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| string |
GetHeaderText(DependencyObject)
Defines the dependency property HeaderText. default String.Empty
Declaration
public static string GetHeaderText(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| string |
GetItemIsCheckedProperty(DependencyObject)
Defines the dependency property ItemIsChecked; Default = "Visibility"
Declaration
public static string GetItemIsCheckedProperty(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| string |
GetItemIsCheckedPropertyConverter(DependencyObject)
Defines the dependency property ItemIsChecked; Default = VisibilityToBooleanConverter
Declaration
public static IValueConverter GetItemIsCheckedPropertyConverter(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| IValueConverter |
GetItemsDisplayOrderProperty(DependencyObject)
Defines the dependency property ItemsDisplayOrderProperty; Default = "ItemsDisplayOrderType.DefaultView"
Declaration
public static ItemsDisplayOrderType? GetItemsDisplayOrderProperty(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| ItemsDisplayOrderType? |
GetItemsSource(DependencyObject)
REQUIRED when using the SelectionOverlay with attached properties on an element which is not of type DataGrid: (a) in case of a data grid the ItemsSource is set to the DataGridColumns (b) in any case: the ItemsSource must be set
Declaration
public static IEnumerable GetItemsSource(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| IEnumerable |
GetNoSearchResultFoundText(DependencyObject)
Defines the dependency property SearchTextWatermark. default String.Empty
Declaration
public static string GetNoSearchResultFoundText(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| string |
GetOpeningOverlayEventName(DependencyObject)
REQUIRED when using the SelectionOverlay with attached properties: defines the routedEventName dependency property which must be an event defined for (a) DataGridColumnHeader (Button) when the sender of the attached property is a datagrid or (b) in any other case is must be an event of the sender itself
Declaration
public static string GetOpeningOverlayEventName(DependencyObject d)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The d. |
Returns
| Type | Description |
|---|---|
| string |
GetSearchTextBoxVisibility(DependencyObject)
Defines the dependency property SearchTextBoxVisibilityProperty. default Visibility.Visible
Declaration
public static Visibility GetSearchTextBoxVisibility(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| Visibility |
GetSearchTextWatermark(DependencyObject)
Defines the dependency property SearchTextWatermark. default String.Empty
Declaration
public static string GetSearchTextWatermark(DependencyObject element)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element |
Returns
| Type | Description |
|---|---|
| string |
IsItemItsOwnContainerOverride(object)
Determines if the specified item is (or is eligible to be) its own ItemContainer.
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| object | item | Specified item. |
Returns
| Type | Description |
|---|---|
| bool | true if the item is its own ItemContainer; otherwise, false. |
Overrides
View SourceOnApplyTemplate()
Called when ApplyTemplate() is called.
Declaration
public override void OnApplyTemplate()
Overrides
View SourcePrepareContainerForItemOverride(DependencyObject, object)
Prepares the specified element to display the specified item.
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | Element used to display the specified item. |
| object | item | Specified item. |
Overrides
View SourceRaiseSelectionChanged(SelectionChangedEventArgs)
Raises the selection changed event.
Declaration
protected virtual void RaiseSelectionChanged(SelectionChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| SelectionChangedEventArgs | e | The SelectionChangedEventArgs instance containing the event data. |
SetCloseButtonVisibility(DependencyObject, Visibility)
Defines the dependency property CloseButtonVisibility. default FALSE
Declaration
public static void SetCloseButtonVisibility(DependencyObject element, Visibility value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| Visibility | value |
SetDisableSelectedItems(DependencyObject, bool)
Defines the dependency property GetDisableSelected. default FALSE
Declaration
public static void SetDisableSelectedItems(DependencyObject element, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| bool | value |
SetDisplayProperty(DependencyObject, string)
Defines the dependency property DisplayOrderProperty; Default = "DisplayProperty"
Declaration
public static void SetDisplayProperty(DependencyObject element, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| string | value |
SetHeaderText(DependencyObject, string)
Defines the dependency property HeaderText. default String.Empty
Declaration
public static void SetHeaderText(DependencyObject element, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| string | value |
SetItemIsCheckedProperty(DependencyObject, string)
Defines the dependency property ItemIsChecked; Default = "Visibility"
Declaration
public static void SetItemIsCheckedProperty(DependencyObject element, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| string | value |
SetItemIsCheckedPropertyConverter(DependencyObject, IValueConverter)
Defines the dependency property ItemIsChecked; Default = VisibilityToBooleanConverter
Declaration
public static void SetItemIsCheckedPropertyConverter(DependencyObject element, IValueConverter value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| IValueConverter | value |
SetItemsDisplayOrderProperty(DependencyObject, ItemsDisplayOrderType)
Defines the dependency property ItemsDisplayOrderProperty; Default = null: and thus order follows DefaultView or when called for DataGrid: special ordering
Declaration
public static void SetItemsDisplayOrderProperty(DependencyObject element, ItemsDisplayOrderType value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| ItemsDisplayOrderType | value |
SetItemsSource(DependencyObject, IEnumerable)
REQUIRED when using the SelectionOverlay with attached properties on an element which is not of type DataGrid: (a) in case of a data grid the ItemsSource is set to the DataGridColumns (b) in any case: the ItemsSource must be set
Declaration
public static void SetItemsSource(DependencyObject element, IEnumerable value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| IEnumerable | value |
SetNoSearchResultFoundText(DependencyObject, string)
Defines the dependency property SearchTextWatermark. default String.Empty
Declaration
public static void SetNoSearchResultFoundText(DependencyObject element, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| string | value |
SetOpeningOverlayEventName(DependencyObject, string)
REQUIRED when using the SelectionOverlay with attached properties: defines the routedEventName dependency property which must be an event defined for (a) DataGridColumnHeader (Button) when the sender of the attached property is a data grid or (b) in any other case is must be an event of the sender itself
Declaration
public static void SetOpeningOverlayEventName(DependencyObject d, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | d | The d. |
| string | value | The value. |
SetSearchTextBoxVisibility(DependencyObject, Visibility)
Defines the dependency property SearchTextBoxVisibilityProperty. default Visibility.Visible
Declaration
public static void SetSearchTextBoxVisibility(DependencyObject element, Visibility value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| Visibility | value |
SetSearchTextWatermark(DependencyObject, string)
Defines the dependency property SearchTextWatermark. default String.Empty
Declaration
public static void SetSearchTextWatermark(DependencyObject element, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | element | |
| string | value |
Events
View SourceSelectionChanged
Occurs when the selection has changed. Attention: in the args the added/removed item container is passed.
Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Type
| Type | Description |
|---|---|
| SelectionChangedEventHandler |