Skip to content

SelectableUserControl

JaykeBird edited this page Feb 21, 2023 · 5 revisions

Back to home | Back to Reference | View raw text

SelectableUserControl class

Description

The basic control that can be added into a SelectPanel. Extend this class to create your own UI elements to use with the SelectPanel.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi
  SolidShineUi.SelectableUserControl[[SelectableUserControl]]
  end
  subgraph System.Windows.Controls
System.Windows.Controls.UserControl[[UserControl]]
  end
System.Windows.Controls.UserControl --> SolidShineUi.SelectableUserControl
Loading

Members

Properties

Public properties

Type Name Methods
Brush Background
Get or set the brush to use for the background of this control.
get, set
bool CanSelect
Get or set if this control can be selected.
get, set
Brush ClickBrush
Get or set the brush to use for the background of this control while it is being clicked.
get, set
Brush HighlightBrush
Get or set the brush to use for the background of this contol while it is highlighted (i.e. has a mouse over it, or has keyboard focus).
get, set
bool IsSelected
Get or set if this control is currently selected.
get, set
Brush SelectedBrush
Get or set the brush to use for the background of this control while it is selected.
get, set

Methods

Public methods

Returns Name
void ApplyColorScheme(ColorScheme cs)
When overridden by a derived class, this method is automatically called each time the color scheme is updated by the parent SelectPanel. Use this to update child controls.
void SetIsSelectedWithSource(bool value, SelectionChangeTrigger triggerMethod, object triggerSource)
Set the SelectableUserControl.IsSelected value of this control, while also defining how the selection was changed.

Details

Summary

The basic control that can be added into a SelectPanel. Extend this class to create your own UI elements to use with the SelectPanel.

Inheritance

  • UserControl

Constructors

SelectableUserControl

public SelectableUserControl()
Summary

Create a SelectableUserControl.

Methods

ApplyColorScheme

public virtual void ApplyColorScheme(ColorScheme cs)
Arguments
Type Name Description
ColorScheme cs The new color scheme.
Summary

When overridden by a derived class, this method is automatically called each time the color scheme is updated by the parent SelectPanel. Use this to update child controls.

SetIsSelectedWithSource

public void SetIsSelectedWithSource(bool value, SelectionChangeTrigger triggerMethod, object triggerSource)
Arguments
Type Name Description
bool value The value to set SelectableUserControl.IsSelected to.
SelectionChangeTrigger triggerMethod The source or method used to trigger the change in selection.
object triggerSource The object that triggered the change.
Summary

Set the SelectableUserControl.IsSelected value of this control, while also defining how the selection was changed.

Properties

ClickBrush

public Brush ClickBrush { get; set; }
Summary

Get or set the brush to use for the background of this control while it is being clicked.

Background

public Brush Background { get; set; }
Summary

Get or set the brush to use for the background of this control.

SelectedBrush

public Brush SelectedBrush { get; set; }
Summary

Get or set the brush to use for the background of this control while it is selected.

HighlightBrush

public Brush HighlightBrush { get; set; }
Summary

Get or set the brush to use for the background of this contol while it is highlighted (i.e. has a mouse over it, or has keyboard focus).

CanSelect

public bool CanSelect { get; set; }
Summary

Get or set if this control can be selected.

IsSelected

public bool IsSelected { get; set; }
Summary

Get or set if this control is currently selected.

Events

SelectionChanged

public event ItemSelectionChangedEventHandler SelectionChanged
Summary

Raised if the IsSelected property is changed.

CanSelectChanged

public event EventHandler CanSelectChanged
Summary

Raised if the CanSelect property is changed.

Click

public event EventHandler Click
Summary

Raised when the control is clicked.

RightClick

public event EventHandler RightClick
Summary

Raised when the control is right-clicked.

Delegates

ItemSelectionChangedEventHandler

public delegate void ItemSelectionChangedEventHandler(object sender, ItemSelectionChangedEventArgs e)
Arguments
Type Name Description
object sender
ItemSelectionChangedEventArgs e

Generated with ModularDoc

Clone this wiki locally