-
Notifications
You must be signed in to change notification settings - Fork 3
SelectableItem
Back to home | Back to Reference | View raw text
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph SolidShineUi
SolidShineUi.SelectableItem[[SelectableItem]]
SolidShineUi.SelectableUserControl[[SelectableUserControl]]
end
subgraph System.Windows.Markup
System.Windows.Markup.IComponentConnector[[IComponentConnector]]
end
System.Windows.Markup.IComponentConnector --> SolidShineUi.SelectableItem
SolidShineUi.SelectableUserControl --> SolidShineUi.SelectableItem
Type | Name | Methods |
---|---|---|
bool |
AllowTextEditing Get or set whether the user should be allowed to edit the text in the Text property. If enabled, a text box will appear when the user clicks on the text. |
get, set |
bool |
AutoShowImageOnSourceSet Get or set whether the ShowImage property should be updated when the ImageSource property is set. Default is true. |
get, set |
CheckState |
CheckboxState Get or set the state of the checkbox. The checkbox is only shown if SelectableItem.ShowCheckbox is set to true. |
get, set |
ImageSource |
ImageSource Get or set the source for the image to show on the left side of the item. If set, the item automatically displays the image (unless AutoShowImageOnSourceSet is set to false). |
get, set |
double |
ImageWidth Get or set the width to afford to the image. By default, the width is set to 16, but larger images will require the width to be set higher. |
get, set |
double |
Indent Get or set the left indent to apply to the item's content. This can be used to make an improvised tree view. |
get, set |
bool |
IsCheckboxChecked Get or set if the checkbox is checked. The checkbox is only shown if SelectableItem.ShowCheckbox is set to true. |
get, set |
bool |
MatchCheckboxValueToSelect Get or set if the checkbox's value should be changed if this control is selected (and vice-versa). Default is true |
get, set |
FontFamily |
RightFontFamily Get or set the FontFamily to use for the text on the right side of the control. |
get, set |
double |
RightFontSize Get or set the font size to use for the text on the right side of the control. |
get, set |
FontStretch |
RightFontStretch Get or set the font stretch to use for the text on the right side of the control. |
get, set |
FontStyle |
RightFontStyle Get or set the FontStyle to use for the text on the right side of the control. |
get, set |
FontWeight |
RightFontWeight Get or set the font weight to use for the text on the right side of the control. |
get, set |
string |
RightText Get or set the text to display on the far-right side of the item. This text cannot be edited directly by the user. |
get, set |
GridLength |
RightTextWidth Get or set the width of the right text section of the control. This can be used to limit the width of the right text section, or make it as wide as needed for the right text to fit fully. |
get, set |
bool |
SelectOnFocusTextEdit Get or set whether all of the text should be selected when the text-editing text box recieves focus. |
get, set |
bool |
ShowCheckbox Get or set whether a checkbox should be displayed on the item. Checkboxes can make it easy to select mutliple items. |
get, set |
bool |
ShowImage Get or set whether to display an image on the left side of the item. Set the image via the ImageSource property. |
get, set |
string |
Text Get or set the text to display within the item. This text can be edited by setting AllowTextEditing to true, or by calling SelectableItem.DisplayEditText . |
get, set |
GridLength |
TextColumnWidth Get or set the width of the main text section of the control. This can be used to limit the width of the main text section, or make it as wide as needed for the full text to fit. |
get, set |
TextTrimming |
TextTrimming Get or set the text trimming behavior to use when the text overflows the visible area. |
get, set |
bool |
TextUnderlineOnMouseOver Get or set if the text should have an underline effect when the mouse is over the text. This is enabled by default when AllowTextEditing is set to "true", but otherwise is disabled. |
get, set |
Returns | Name |
---|---|
void |
ApplyColorScheme (ColorScheme cs)Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control. |
void |
CancelEdit ()Cancel the user's edit to the text and exits the text editing view (if in the view). This can be called at any time. |
void |
ConfirmEdit ()Confirm the user's edit to the text, as changed via the text editing view. Also exits the text editing view. This can only be called when in the text editing view. |
void |
DisplayEditText ()Display the text editing view to the user. This is the same as the user clicking on the text while AllowTextEditing is set to true. |
void |
InitializeComponent ()InitializeComponent |
Returns | Name |
---|---|
Delegate |
_CreateDelegate (Type delegateType, string handler) |
IComponentConnector
-
SelectableUserControl
public SelectableItem()
Create a SelectableItem to use with a SelectPanel.
public SelectableItem(string text)
Type | Name | Description |
---|---|---|
string |
text | The text to display in the item. |
Create a SelectableItem to use with a SelectPanel, with the text preset.
public SelectableItem(string text, ImageSource image, double indent)
Type | Name | Description |
---|---|---|
string |
text | The text to display in the item. |
ImageSource |
image | The image to display in the item. (If the image is wider than 16 pixels, you may need to update the ImageWidth property.) Set to null to not show an image. |
double |
indent | The left indent to apply to the item's content. The indent can be used to make an improvised tree view. |
Create a SelectableItem to use with a SelectPanel, with certain properties preset.
public override void ApplyColorScheme(ColorScheme cs)
Type | Name | Description |
---|---|---|
ColorScheme |
cs | The color scheme to apply. |
Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.
public void DisplayEditText()
Display the text editing view to the user. This is the same as the user clicking on the text while AllowTextEditing
is set to true.
This method will activate the text editing view even if AllowTextEditing
is set to false.
public void ConfirmEdit()
Confirm the user's edit to the text, as changed via the text editing view. Also exits the text editing view. This can only be called when in the text editing view.
Name | Description |
---|---|
InvalidOperationException | Thrown if this item is not in the text editing view. |
public void CancelEdit()
Cancel the user's edit to the text and exits the text editing view (if in the view). This can be called at any time.
public virtual void InitializeComponent()
InitializeComponent
internal Delegate _CreateDelegate(Type delegateType, string handler)
Type | Name | Description |
---|---|---|
Type |
delegateType | |
string |
handler |
public double Indent { get; set; }
Get or set the left indent to apply to the item's content. This can be used to make an improvised tree view.
public bool ShowCheckbox { get; set; }
Get or set whether a checkbox should be displayed on the item. Checkboxes can make it easy to select mutliple items.
public CheckState CheckboxState { get; set; }
Get or set the state of the checkbox. The checkbox is only shown if SelectableItem.ShowCheckbox is set to true.
public bool IsCheckboxChecked { get; set; }
Get or set if the checkbox is checked. The checkbox is only shown if SelectableItem.ShowCheckbox is set to true.
public bool MatchCheckboxValueToSelect { get; set; }
Get or set if the checkbox's value should be changed if this control is selected (and vice-versa). Default is true
public double ImageWidth { get; set; }
Get or set the width to afford to the image. By default, the width is set to 16, but larger images will require the width to be set higher.
public bool ShowImage { get; set; }
Get or set whether to display an image on the left side of the item. Set the image via the ImageSource
property.
public ImageSource ImageSource { get; set; }
Get or set the source for the image to show on the left side of the item. If set, the item automatically displays the image (unless AutoShowImageOnSourceSet
is set to false).
public bool AutoShowImageOnSourceSet { get; set; }
Get or set whether the ShowImage
property should be updated when the ImageSource
property is set. Default is true.
public string Text { get; set; }
Get or set the text to display within the item. This text can be edited by setting AllowTextEditing
to true, or by calling SelectableItem.DisplayEditText .
public GridLength TextColumnWidth { get; set; }
Get or set the width of the main text section of the control. This can be used to limit the width of the main text section, or make it as wide as needed for the full text to fit.
public TextTrimming TextTrimming { get; set; }
Get or set the text trimming behavior to use when the text overflows the visible area.
public string RightText { get; set; }
Get or set the text to display on the far-right side of the item. This text cannot be edited directly by the user.
public FontFamily RightFontFamily { get; set; }
Get or set the FontFamily to use for the text on the right side of the control.
public double RightFontSize { get; set; }
Get or set the font size to use for the text on the right side of the control.
public FontWeight RightFontWeight { get; set; }
Get or set the font weight to use for the text on the right side of the control.
public FontStretch RightFontStretch { get; set; }
Get or set the font stretch to use for the text on the right side of the control.
public FontStyle RightFontStyle { get; set; }
Get or set the FontStyle to use for the text on the right side of the control.
public GridLength RightTextWidth { get; set; }
Get or set the width of the right text section of the control. This can be used to limit the width of the right text section, or make it as wide as needed for the right text to fit fully.
public bool TextUnderlineOnMouseOver { get; set; }
Get or set if the text should have an underline effect when the mouse is over the text. This is enabled by default when AllowTextEditing
is set to "true", but otherwise is disabled.
public bool SelectOnFocusTextEdit { get; set; }
Get or set whether all of the text should be selected when the text-editing text box recieves focus.
public bool AllowTextEditing { get; set; }
Get or set whether the user should be allowed to edit the text in the Text property. If enabled, a text box will appear when the user clicks on the text.
While editing, pressing "Enter" will confirm the edit, while pressing "Escape" will cancel the operation.
public event RoutedPropertyChangedEventHandler<string> TextChanged
Raised when the Text property is changed, either via updating the property or via the the user's text editing view.
Generated with ModularDoc