ActionCard
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Displays an actionable card with plain-text details, icon, badge, commands, and optional hosted content.
- C#
- VB.NET
public class ActionCard : Control
Public Class ActionCard
Inherits Control
Clicking the card header raises Click and toggles Selected when Selectable is true. Actions and hosted controls have independent input and never invoke the card header. All text is literal, not HTML.
Example:
var card = new ActionCard
{
Title = "Rotate TLS certificates", Description = "12 gateways in Europe and Africa",
Badge = "Due in 3 days", BadgeTone = ActionCardTone.Warning, Selectable = true
};
card.Actions.Add(new CardAction { Name = "snooze", Text = "Snooze" });
card.Actions.Add(new CardAction { Name = "run", Text = "Run now", Primary = true });
card.ActionClick += (sender, e) => MessageBox.Show(e.Action.Name);
this.Controls.Add(card);
Constructors
ActionCard()
Initializes a flat card without commands or hosted content.
Properties
Actions
CardActionCollection: Gets the ordered command collection. Edits update the card automatically.
Badge
String: Gets or sets the plain-text badge label. The default is empty. (Default: "")
BadgeTone
ActionCardTone: Gets or sets the badge's semantic color. The default is Neutral. (Default: Neutral)
Content
Control: Gets or sets the optional Wisej control displayed below the header. (Default: null)
Content must be unparented and cannot contain the card. The card owns attached content and disposes it with the card. Replacing or clearing Content detaches the old control without disposing it. Content fills the card width and retains its Height; choose a card height large enough to contain it.
Example:
card.Content = new TextBox { Watermark = "Deployment notes", Height = 32 };
var reusable = card.Content;
card.Content = null; // The control remains alive for reuse.
DefaultSize
Size: Gets the default card size.
Description
String: Gets or sets the plain-text description. The default is empty. (Default: "")
Elevation
ActionCardElevation: Gets or sets the themed surface elevation. The default is Flat. (Default: Flat)
Focusable
Boolean: Gets or sets root focusability. The header remains keyboard accessible. (Default: False)
Icon
String: Gets or sets the icon source URL or Wisej theme image name. The default is empty. (Default: "")
IconTone
ActionCardTone: Gets or sets the icon's semantic color. The default is Primary. (Default: Primary)
Meta
String: Gets or sets the plain-text metadata line. The default is empty. (Default: "")
Selectable
Boolean: Gets or sets whether header activation toggles Selected. The default is false. (Default: False)
Click is raised even when Selectable is false. Changing Selectable does not reset an existing selection. This member hides Control.Selectable, which controls browser text selection rather than card selection.
Selected
Boolean: Gets or sets the selected state. The default is false. (Default: False)
Code can set Selected regardless of Selectable. Each actual change raises SelectedChanged.
TabStop
Boolean: Gets or sets root tab-stop participation. The header and commands manage their own keyboard focus. (Default: False)
Title
String: Gets or sets the plain-text title. The default is empty. (Default: "")
Methods
Dispose(disposing)
Releases command subscriptions and disposes currently attached content through the base control.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | Whether managed resources should be released. |
OnActionClick(e)
Raises ActionClick.
| Parameter | Type | Description |
|---|---|---|
| e | CardActionEventArgs | Invoked command. |
OnSelectedChanged(e)
Raises SelectedChanged.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | Event data. |
OnWebEvent(e)
Dispatches client events, suppressing duplicate standard tap handling.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Client event. |
OnWebRender(config)
Serializes the current card and independently wires normal events.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Client configuration. |
Events
ActionClick
EventHandler<CardActionEventArgs> Occurs when an enabled command is invoked by pointer or keyboard.
SelectedChanged
EventHandler Occurs after Selected changes through user interaction or code.
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IBindableComponent | Bindable components implement this interface. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |