-
Notifications
You must be signed in to change notification settings - Fork 3
SelectPanel
Back to home | Back to Reference | View raw text
A ListBox-like control that can be used to select and interact with multiple items, with extra functionality and a visual style that matches the rest of the Solid Shine UI controls.
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph SolidShineUi
SolidShineUi.SelectPanel[[SelectPanel]]
end
subgraph System.Windows.Controls
System.Windows.Controls.Control[[Control]]
end
System.Windows.Controls.Control --> SolidShineUi.SelectPanel
Type | Name | Methods |
---|---|---|
bool |
AllowParentScrolling Set whether the SelectPanel should allow its parent to scroll if the SelectPanel doesn't need to scroll. Note that enabling this may disable any child items from scrolling. |
get, set |
Brush |
Background Get or set the brush used for the background of this control. |
get, set |
Brush |
BorderBrush Get or set the brush used for the border around this control. |
get, set |
Brush |
BorderDisabledBrush Get or set the brush used for the border when this control is disabled. |
get, set |
Thickness |
BorderThickness Get or set the thickness of the border around this control. |
get, set |
Brush |
ClickBrush Get or set the brush used when an item in this control is being clicked. |
get, set |
ColorScheme |
ColorScheme Get or set the color scheme to apply to the control. The color scheme can quickly apply a whole visual style to your control. |
get, set |
CornerRadius |
CornerRadius Get or set the corner radius (or radii) to use for the control's border. Setting the corners to 0 means there is no rounding; square corners are used. Any corners with a higher number will be rounded. |
get, set |
int |
Count Gets the number of items in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.Count . |
get |
Brush |
DisabledBrush Get or set the brush used for the background when this control is disabled. |
get, set |
Brush |
HighlightBrush Get or set the brush used when an item in this control is highlighted (i.e. has the mouse over it or has keyboard focus). |
get, set |
ScrollBarVisibility |
HorizontalScrollBarVisibility Get or set the appearance of the horizontal scroll bar for this control. |
get, set |
SelectableUserControl |
Item |
get |
SelectableCollection <SelectableUserControl > |
Items Get or set the list of items in this SelectPanel. This Items property can be used to add items, remove items, and also select items via the Select method. |
get |
IEnumerable <SelectableUserControl > |
ItemsSource Gets or sets a collection used to generate the content of this SelectPanel. |
get, set |
bool |
MultiSelect Get or set if multiple items can be selected at once. If false, then only 1 item can be selected at a time. |
get, set |
Brush |
SelectedBrush Get or set the brush used when an item in this control is selected. |
get, set |
int |
SelectionCount Gets the number of items that are currently selected. Note that this function will be removed in a future version. Please instead use Items.SelectedItems.Count . |
get |
bool |
UseLighterBorder Use a lighter border color when applying color schemes. Note that this does not apply in high-contrast mode, nor does it apply if you are not using color schemes to set this control's appearance. |
get, set |
ScrollBarVisibility |
VerticalScrollBarVisibility Get or set the appearance of the vertical scroll bar for this control. |
get, set |
Returns | Name |
---|---|
void |
OnColorSchemeChanged (DependencyObject d, DependencyPropertyChangedEventArgs e)Perform an action when the ColorScheme property has changed. Primarily used internally. |
Returns | Name |
---|---|
void |
AddItem (SelectableUserControl item)Add an item to this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.Add . |
void |
AddItems (IEnumerable <SelectableUserControl > items) |
void |
ApplyColorScheme (ColorScheme cs, bool useLighterBorder)Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control. |
void |
Clear ()Clear all items in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.Clear . |
void |
DeselectAll ()Deselect all items in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.ClearSelection . |
SelectableUserControl |
Get (int index)Get an item at a specified index in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items[] . |
IEnumerable <T > |
GetItemsAsType () |
IEnumerable <T > |
GetSelectedItemsOfType () |
int |
IndexOf (SelectableUserControl item)Get the index of an item in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.IndexOf . |
void |
InsertItem (int index, SelectableUserControl item)Insert an item into this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.Insert . |
void |
InsertItems (int index, IEnumerable <SelectableUserControl > items) |
void |
MoveItemDown (int index)Move an item in the SelectPanel down by one position in the list. |
void |
MoveItemUp (int index)Move an item in the SelectPanel up by one position in the list. |
void |
MoveSelectedItemsDown ()Move the currently selected items down by one in the list. |
void |
MoveSelectedItemsUp ()Move the currently selected items up by one in the list. |
void |
RemoveAt (int index)Remove an item at a specified index from this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.RemoveAt . |
void |
RemoveItem (SelectableUserControl item)Remove an item from this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.Remove . |
void |
RemoveItems (IEnumerable <SelectableUserControl > items) |
void |
RemoveSelectedItems ()Remove the currently selected items from the list. |
void |
SelectAll ()Select all items in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.SelectAll . |
A ListBox-like control that can be used to select and interact with multiple items, with extra functionality and a visual style that matches the rest of the Solid Shine UI controls.
Control
public SelectPanel()
Create a new NewSelectPanel.
public static void OnColorSchemeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Type | Name | Description |
---|---|---|
DependencyObject |
d | The object containing the property that changed. |
DependencyPropertyChangedEventArgs |
e | Event arguments about the property change. |
Perform an action when the ColorScheme property has changed. Primarily used internally.
public void ApplyColorScheme(ColorScheme cs, bool useLighterBorder)
Type | Name | Description |
---|---|---|
ColorScheme |
cs | The color scheme to apply. |
bool |
useLighterBorder | Set if a lighter border color should be used. |
Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.
public IEnumerable<T> GetSelectedItemsOfType<T>()
where T : SelectableUserControl
public void SelectAll()
Select all items in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.SelectAll
.
public void DeselectAll()
Deselect all items in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.ClearSelection
.
public void AddItem(SelectableUserControl item)
Type | Name | Description |
---|---|---|
SelectableUserControl |
item | Item to be added. |
Add an item to this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.Add
.
public void AddItems(IEnumerable<SelectableUserControl> items)
Type | Name | Description |
---|---|---|
IEnumerable <SelectableUserControl > |
items |
public void InsertItem(int index, SelectableUserControl item)
Type | Name | Description |
---|---|---|
int |
index | The index to insert the item at. |
SelectableUserControl |
item | The item to insert. |
Insert an item into this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.Insert
.
public void InsertItems(int index, IEnumerable<SelectableUserControl> items)
Type | Name | Description |
---|---|---|
int |
index | |
IEnumerable <SelectableUserControl > |
items |
public IEnumerable<T> GetItemsAsType<T>()
where T : SelectableUserControl
public void RemoveItem(SelectableUserControl item)
Type | Name | Description |
---|---|---|
SelectableUserControl |
item | The item to be removed. |
Remove an item from this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.Remove
.
public void RemoveItems(IEnumerable<SelectableUserControl> items)
Type | Name | Description |
---|---|---|
IEnumerable <SelectableUserControl > |
items |
public void RemoveAt(int index)
Type | Name | Description |
---|---|---|
int |
index | The index of the item to be removed. |
Remove an item at a specified index from this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.RemoveAt
.
public void RemoveSelectedItems()
Remove the currently selected items from the list.
Note: unlike many other functions, this one is not being removed in a near future version.
public int IndexOf(SelectableUserControl item)
Type | Name | Description |
---|---|---|
SelectableUserControl |
item | The item to get the index of. |
Get the index of an item in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.IndexOf
.
public SelectableUserControl Get(int index)
Type | Name | Description |
---|---|---|
int |
index | The index of the item to be removed. |
Get an item at a specified index in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items[]
.
public void Clear()
Clear all items in this SelectPanel. Note that this function will be removed in a future version. Please instead use Items.Clear
.
public void MoveSelectedItemsUp()
Move the currently selected items up by one in the list.
public void MoveSelectedItemsDown()
Move the currently selected items down by one in the list.
This function does not operate if the ItemsSource is set to a different collection.
public void MoveItemUp(int index)
Type | Name | Description |
---|---|---|
int |
index | The index of the item to move. |
Move an item in the SelectPanel up by one position in the list.
If the index passed in is 0, then nothing is moved, as it's already at the top of the list. This function does not operate if the ItemsSource is set to a different collection.
Name | Description |
---|---|
ArgumentOutOfRangeException | Thrown if the index passed in is beyond the number of items in the collection. |
public void MoveItemDown(int index)
Type | Name | Description |
---|---|---|
int |
index | The index of the item to move. |
Move an item in the SelectPanel down by one position in the list.
If the index passed in is the last index in the collection, then nothing is moved, as it's already at the bottom of the list. This function does not operate if the ItemsSource is set to a different collection.
Name | Description |
---|---|
ArgumentOutOfRangeException | Thrown if the index passed in is beyond the number of items in the collection. |
public IEnumerable<SelectableUserControl> ItemsSource { get; set; }
Gets or sets a collection used to generate the content of this SelectPanel.
It is recommended to set this property to an ObservableCollection<ModularDoc.Elements.Markdown.TextElement> , SelectableCollection<T> , or SelectableCollectionView<T> . If you use other IEnumerable types that do not also implement INotifyCollectionChanged , then this control's contents will not update automatically. If you do not use a SelectableCollection or SelectableCollectionView, you may also need to implement your own code for handling the selection state of the items in your collection.
public SelectableCollection<SelectableUserControl> Items { get; }
Get or set the list of items in this SelectPanel. This Items property can be used to add items, remove items, and also select items via the Select method.
public bool MultiSelect { get; set; }
Get or set if multiple items can be selected at once. If false, then only 1 item can be selected at a time.
public ColorScheme ColorScheme { get; set; }
Get or set the color scheme to apply to the control. The color scheme can quickly apply a whole visual style to your control.
public bool UseLighterBorder { get; set; }
Use a lighter border color when applying color schemes. Note that this does not apply in high-contrast mode, nor does it apply if you are not using color schemes to set this control's appearance.
public ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }
Get or set the appearance of the horizontal scroll bar for this control.
public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
Get or set the appearance of the vertical scroll bar for this control.
public Brush Background { get; set; }
Get or set the brush used for the background of this control.
public Brush ClickBrush { get; set; }
Get or set the brush used when an item in this control is being clicked.
public Brush SelectedBrush { get; set; }
Get or set the brush used when an item in this control is selected.
public Brush HighlightBrush { get; set; }
Get or set the brush used when an item in this control is highlighted (i.e. has the mouse over it or has keyboard focus).
public Brush DisabledBrush { get; set; }
Get or set the brush used for the background when this control is disabled.
public Brush BorderDisabledBrush { get; set; }
Get or set the brush used for the border when this control is disabled.
public Brush BorderBrush { get; set; }
Get or set the brush used for the border around this control.
public Thickness BorderThickness { get; set; }
Get or set the thickness of the border around this control.
public CornerRadius CornerRadius { get; set; }
Get or set the corner radius (or radii) to use for the control's border. Setting the corners to 0 means there is no rounding; square corners are used. Any corners with a higher number will be rounded.
public int Count { get; }
Gets the number of items in this SelectPanel.
Note that this function will be removed in a future version. Please instead use Items.Count
.
public int SelectionCount { get; }
Gets the number of items that are currently selected.
Note that this function will be removed in a future version. Please instead use Items.SelectedItems.Count
.
public SelectableUserControl Item { get; }
public bool AllowParentScrolling { get; set; }
Set whether the SelectPanel should allow its parent to scroll if the SelectPanel doesn't need to scroll. Note that enabling this may disable any child items from scrolling.
public event DependencyPropertyChangedEventHandler ColorSchemeChanged
Raised when the ColorScheme property is changed.
public event SelectionChangedEventHandler SelectionChanged
Raised when an item is selected or deselected in this list.
public event SelectionChangedEventHandler ItemsAdded
Raised when an item is added to this list.
public event SelectionChangedEventHandler ItemsRemoved
Raised when an item is removed from this list.
Generated with ModularDoc