Vereinsmeisterschaften  22aa7800eae54b428d40e835886cefe1fdefdfdf
This is a software that can be used to manage the internal competition of the swimming club Illertissen called "Vereinsmeisterschaften".
Loading...
Searching...
No Matches
Vereinsmeisterschaften.Controls.MultiSelectComboBox Class Reference

Control for a ComboBox that allows multiple selection via CheckBoxes. More...

Inheritance diagram for Vereinsmeisterschaften.Controls.MultiSelectComboBox:

Static Public Attributes

static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register(nameof(ItemsSource), typeof(IEnumerable), typeof(MultiSelectComboBox), new PropertyMetadata(null))
 
static readonly DependencyProperty SelectedItemsProperty = DependencyProperty.Register(nameof(SelectedItems), typeof(IList), typeof(MultiSelectComboBox), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault))
 
static readonly DependencyProperty ItemTemplateProperty = DependencyProperty.Register(nameof(ItemTemplate), typeof(DataTemplate), typeof(MultiSelectComboBox), new PropertyMetadata(null))
 
static readonly DependencyProperty IsPopupOpenProperty = DependencyProperty.Register(nameof(IsPopupOpen), typeof(bool), typeof(MultiSelectComboBox), new PropertyMetadata(false, OnIsPopupOpenChanged))
 

Properties

IEnumerable ItemsSource [get, set]
 List with all available items.
 
IList SelectedItems [get, set]
 List with all selected items.
 
DataTemplate ItemTemplate [get, set]
 Template used to display the Checkbox contents and the selected items.
 
bool IsPopupOpen [get, set]
 True, when the popup with the selection options is open.
 

Private Member Functions

void OnTogglePopup (object sender, System.Windows.Input.MouseButtonEventArgs e)
 Toggle the popup open/closed when clicking on the control, but not when clicking the remove button of an item.
 
void PART_ComboBoxContent_MouseEnter (object sender, MouseEventArgs e)
 
void PART_ComboBoxContent_MouseLeave (object sender, MouseEventArgs e)
 
void refreshPopupCheckBoxes ()
 Refresh the state of all CheckBoxes in the popup.
 
void PART_PopupCheckbox_Checked (object sender, RoutedEventArgs e)
 Checkbox checked event handler to add the item to the SelectedItems collection.
 
void PART_PopupCheckbox_Unchecked (object sender, RoutedEventArgs e)
 Checkbox unchecked event handler to remove the item from the SelectedItems collection.
 
void RemoveItem (object item)
 Command to remove an item from the SelectedItems collection.
 
findParentOfType< T > (DependencyObject child)
 Find the next parent with the requested type from the child.
 

Static Private Member Functions

static void OnIsPopupOpenChanged (DependencyObject d, DependencyPropertyChangedEventArgs e)
 
static IEnumerable< T > findVisualChildren< T > (DependencyObject depObj)
 Find all visual children of a given type.
 

Detailed Description

Control for a ComboBox that allows multiple selection via CheckBoxes.

Definition at line 15 of file MultiSelectComboBox.xaml.cs.

Constructor & Destructor Documentation

◆ MultiSelectComboBox()

Vereinsmeisterschaften.Controls.MultiSelectComboBox.MultiSelectComboBox ( )

Definition at line 19 of file MultiSelectComboBox.xaml.cs.

Member Function Documentation

◆ findParentOfType< T >()

T Vereinsmeisterschaften.Controls.MultiSelectComboBox.findParentOfType< T > ( DependencyObject child)
private

Find the next parent with the requested type from the child.

Template Parameters
TRequested parent type
Parameters
childChild to start the search from
Returns
Next parent with requested type of null if not found
Type Constraints
T :DependencyObject 

Definition at line 204 of file MultiSelectComboBox.xaml.cs.

◆ findVisualChildren< T >()

static IEnumerable< T > Vereinsmeisterschaften.Controls.MultiSelectComboBox.findVisualChildren< T > ( DependencyObject depObj)
staticprivate

Find all visual children of a given type.

Template Parameters
TChildren type
Parameters
depObjParent object to start the search from
Returns
List of children with the requested type
Type Constraints
T :DependencyObject 

Definition at line 224 of file MultiSelectComboBox.xaml.cs.

◆ OnIsPopupOpenChanged()

static void Vereinsmeisterschaften.Controls.MultiSelectComboBox.OnIsPopupOpenChanged ( DependencyObject d,
DependencyPropertyChangedEventArgs e )
staticprivate

Definition at line 70 of file MultiSelectComboBox.xaml.cs.

◆ OnTogglePopup()

void Vereinsmeisterschaften.Controls.MultiSelectComboBox.OnTogglePopup ( object sender,
System.Windows.Input.MouseButtonEventArgs e )
private

Toggle the popup open/closed when clicking on the control, but not when clicking the remove button of an item.

Parameters
sender
e

Definition at line 90 of file MultiSelectComboBox.xaml.cs.

◆ PART_ComboBoxContent_MouseEnter()

void Vereinsmeisterschaften.Controls.MultiSelectComboBox.PART_ComboBoxContent_MouseEnter ( object sender,
MouseEventArgs e )
private

Definition at line 110 of file MultiSelectComboBox.xaml.cs.

◆ PART_ComboBoxContent_MouseLeave()

void Vereinsmeisterschaften.Controls.MultiSelectComboBox.PART_ComboBoxContent_MouseLeave ( object sender,
MouseEventArgs e )
private

Definition at line 116 of file MultiSelectComboBox.xaml.cs.

◆ PART_PopupCheckbox_Checked()

void Vereinsmeisterschaften.Controls.MultiSelectComboBox.PART_PopupCheckbox_Checked ( object sender,
RoutedEventArgs e )
private

Checkbox checked event handler to add the item to the SelectedItems collection.

Parameters
senderSending CheckBox
eRoutedEventArgs

Definition at line 147 of file MultiSelectComboBox.xaml.cs.

◆ PART_PopupCheckbox_Unchecked()

void Vereinsmeisterschaften.Controls.MultiSelectComboBox.PART_PopupCheckbox_Unchecked ( object sender,
RoutedEventArgs e )
private

Checkbox unchecked event handler to remove the item from the SelectedItems collection.

Parameters
senderSending CheckBox
eRoutedEventArgs

Definition at line 163 of file MultiSelectComboBox.xaml.cs.

◆ refreshPopupCheckBoxes()

void Vereinsmeisterschaften.Controls.MultiSelectComboBox.refreshPopupCheckBoxes ( )
private

Refresh the state of all CheckBoxes in the popup.

Definition at line 124 of file MultiSelectComboBox.xaml.cs.

◆ RemoveItem()

void Vereinsmeisterschaften.Controls.MultiSelectComboBox.RemoveItem ( object item)
private

Command to remove an item from the SelectedItems collection.

Definition at line 184 of file MultiSelectComboBox.xaml.cs.

Member Data Documentation

◆ IsPopupOpenProperty

readonly DependencyProperty Vereinsmeisterschaften.Controls.MultiSelectComboBox.IsPopupOpenProperty = DependencyProperty.Register(nameof(IsPopupOpen), typeof(bool), typeof(MultiSelectComboBox), new PropertyMetadata(false, OnIsPopupOpenChanged))
static

Definition at line 68 of file MultiSelectComboBox.xaml.cs.

◆ ItemsSourceProperty

readonly DependencyProperty Vereinsmeisterschaften.Controls.MultiSelectComboBox.ItemsSourceProperty = DependencyProperty.Register(nameof(ItemsSource), typeof(IEnumerable), typeof(MultiSelectComboBox), new PropertyMetadata(null))
static

Definition at line 38 of file MultiSelectComboBox.xaml.cs.

◆ ItemTemplateProperty

readonly DependencyProperty Vereinsmeisterschaften.Controls.MultiSelectComboBox.ItemTemplateProperty = DependencyProperty.Register(nameof(ItemTemplate), typeof(DataTemplate), typeof(MultiSelectComboBox), new PropertyMetadata(null))
static

Definition at line 58 of file MultiSelectComboBox.xaml.cs.

◆ SelectedItemsProperty

readonly DependencyProperty Vereinsmeisterschaften.Controls.MultiSelectComboBox.SelectedItemsProperty = DependencyProperty.Register(nameof(SelectedItems), typeof(IList), typeof(MultiSelectComboBox), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault))
static

Definition at line 48 of file MultiSelectComboBox.xaml.cs.

Property Documentation

◆ IsPopupOpen

bool Vereinsmeisterschaften.Controls.MultiSelectComboBox.IsPopupOpen
getset

True, when the popup with the selection options is open.

Definition at line 63 of file MultiSelectComboBox.xaml.cs.

◆ ItemsSource

IEnumerable Vereinsmeisterschaften.Controls.MultiSelectComboBox.ItemsSource
getset

List with all available items.

Definition at line 33 of file MultiSelectComboBox.xaml.cs.

◆ ItemTemplate

DataTemplate Vereinsmeisterschaften.Controls.MultiSelectComboBox.ItemTemplate
getset

Template used to display the Checkbox contents and the selected items.

Definition at line 53 of file MultiSelectComboBox.xaml.cs.

◆ SelectedItems

IList Vereinsmeisterschaften.Controls.MultiSelectComboBox.SelectedItems
getset

List with all selected items.

Definition at line 43 of file MultiSelectComboBox.xaml.cs.


The documentation for this class was generated from the following file: