Repository navigation
workspace sdk dashboard widgets
Dashboard widgets appear in Security Desk's dashboard pages. Operators add widgets from a picker panel that displays each widget's name, description, and thumbnail. Once placed on a dashboard, widgets provide live visual content that can refresh automatically and expose configuration options.
Use a dashboard widget when operators need always-visible status, summary data, or lightweight controls on a dashboard page rather than a full page or tile extension.
Note
For tile-based monitoring pages instead of dashboard pages, see About content builders to control what appears inside a tile. See About tile extensions to add side-panel controls, in-tile overlays, and configuration tabs for the selected tile.
Creating a dashboard widget requires two classes:
-
DashboardWidgetBuilder- registered as a component, acts as a factory that creates widget instances -
DashboardWidget- provides the visual content and configuration for a placed widget
- Your module registers a
DashboardWidgetBuildercomponent. - Security Desk lists the builder in the dashboard widget picker using the builder's metadata.
- When an operator adds the widget, the framework calls
CreateWidget(...)to create aDashboardWidgetinstance. - The widget creates its visual content through
CreateView(). - The dashboard refreshes or resizes the widget according to its capabilities and settings.
- When the module unloads, it unregisters the builder.
Inherit from DashboardWidgetBuilder and implement the abstract members:
public class MyWidgetBuilder : DashboardWidgetBuilder
{
public override string Name => "My Widget Builder";
public override Guid UniqueId => new Guid("A1B2C3D4-E5F6-7890-ABCD-EF1234567890");
public override string Description => "Displays real-time status information.";
public override BitmapSource Thumbnail => new BitmapImage(new Uri("pack://application:,,,/MyPlugin;component/Resources/widget.png"));
public override bool IsSupported(DashboardWidgetBuilderContext context)
{
return context.Type == UniqueId;
}
public override DashboardWidget CreateWidget(DashboardWidgetBuilderContext context)
{
return new MyWidget();
}
}| Member | Type | Description |
|---|---|---|
Name |
Property (abstract) | Name shown in the widget picker. |
UniqueId |
Property (abstract) | Identifier for this builder. Use the same value that the widget returns from WidgetTypeId. |
Description |
Property (abstract) | Widget description displayed in the widget picker. |
Thumbnail |
Property (abstract) | Preview image displayed in the widget picker. |
Category |
Property (virtual) | Widget category identifier. Defaults to Guid.Empty. |
Priority |
Property (virtual) | Display order in the widget picker. Lower values appear first. Defaults to int.MaxValue. |
IsSupported(DashboardWidgetBuilderContext) |
Method (abstract) | Return true when the widget can be created in the given context. |
CreateWidget(DashboardWidgetBuilderContext) |
Method (abstract) | Create and return a new DashboardWidget instance. |
The DashboardWidgetCategories class provides built-in category identifiers for the widget picker. Return one of these values from DashboardWidgetBuilder.Category to place your widget under a built-in group.
| Constant | Description |
|---|---|
DashboardWidgetCategories.GeneralId |
General-purpose widgets. |
DashboardWidgetCategories.AccessControlId |
Access-control widgets. |
DashboardWidgetCategories.VideoId |
Video-related widgets. |
DashboardWidgetCategories.ReportingId |
Reporting widgets. |
DashboardWidgetCategories.HealthId |
Health and status widgets. |
public override Guid Category => DashboardWidgetCategories.VideoId;The context passed to IsSupported and CreateWidget provides:
| Member | Type | Description |
|---|---|---|
Type |
Guid |
The widget's unique type identifier. |
Inherit from DashboardWidget and implement the abstract members:
public class MyWidget : DashboardWidget
{
public override Guid WidgetTypeId => new Guid("A1B2C3D4-E5F6-7890-ABCD-EF1234567890");
public override string WidgetName => "My Widget";
public override UIElement CreateView()
{
return new MyWidgetControl();
}
public override void Refresh()
{
// Update the widget's data
}
}Important
The WidgetTypeId must match the UniqueId of the corresponding DashboardWidgetBuilder. The system uses this identifier to associate placed widgets with their builder.
| Member | Type | Description |
|---|---|---|
WidgetTypeId |
Property (abstract) | Unique identifier for this widget type. Must match the builder's UniqueId. |
WidgetName |
Property (abstract) | Title displayed in the widget's configuration panel. |
CreateView() |
Method (abstract) | Create the widget's visual content. Called once when the widget is first displayed. |
| Member | Type | Description |
|---|---|---|
WidgetSize |
Property (virtual) | Default dimensions in grid cells. Defaults to 2x2. |
MinWidgetSize |
Property (virtual) | Minimum dimensions in grid cells. Defaults to 2x2. |
MaxWidgetSize |
Property (virtual) | Maximum dimensions in grid cells. Defaults to unlimited. |
IsResizableHorizontally |
Property (virtual) | Whether the widget can be resized horizontally. Defaults to true. |
IsResizableVertically |
Property (virtual) | Whether the widget can be resized vertically. Defaults to true. |
| Member | Type | Description |
|---|---|---|
DefaultShowTitle |
Property (virtual) | Whether to display the title above the widget. Defaults to false. |
DefaultTitle |
Property (virtual) | Title text displayed above the widget when DefaultShowTitle is true. Not set by default; override to supply a title. |
DefaultBackgroundColor |
Property (virtual) | Widget background color. Defaults to dark gray (#282828). |
| Member | Type | Description |
|---|---|---|
IsRefreshable |
Property (virtual) | Whether the widget supports refreshing. Defaults to true. |
DefaultRefreshAutomatically |
Property (virtual) | Whether the widget refreshes on a timer by default. Defaults to false. |
DefaultRefreshInterval |
Property (virtual) | Timer interval for automatic refresh. Defaults to 1 minute. The minimum is 1 minute and the interval must be a whole number of minutes. |
Refresh() |
Method (virtual) | Called when the widget needs to update its data. Override to reload content. |
CancelRefresh() |
Method (virtual) | Called to cancel an in-progress refresh operation. |
public override UIElement CreateOptionsView()
{
return new MyWidgetOptionsControl();
}| Member | Type | Description |
|---|---|---|
CreateOptionsView() |
Method (virtual) | Create a configuration panel for the widget. Returns null by default (no options panel). The options panel maximum width is 350 pixels. |
OnModified() |
Method (protected) | Call this when the widget's configuration changes to notify the dashboard to save. |
Override Serialize and Deserialize to persist widget-specific configuration across sessions:
public override string Serialize()
{
return m_selectedEntityId.ToString();
}
public override void Deserialize(string value)
{
if (Guid.TryParse(value, out var entityId))
{
m_selectedEntityId = entityId;
}
}| Member | Type | Description |
|---|---|---|
Serialize() |
Method (virtual) | Return a string representing the widget's configuration. Returns null by default. |
Deserialize(string) |
Method (virtual) | Restore the widget's configuration from a previously serialized string. |
| Member | Type | Description |
|---|---|---|
Dispose() |
Method (virtual) | Called when the widget is removed from the dashboard. Override to release resources. The base implementation disposes the view and options view if they implement IDisposable. |
Important
This component requires a valid SDK certificate.
Register the builder in your module's Load method. Dashboard widgets are only available in Security Desk.
public class SampleModule : Module
{
private MyWidgetBuilder m_widgetBuilder;
public override void Load()
{
if (Workspace.ApplicationType == ApplicationType.SecurityDesk)
{
m_widgetBuilder = new MyWidgetBuilder();
m_widgetBuilder.Initialize(Workspace);
Workspace.Components.Register(m_widgetBuilder);
}
}
public override void Unload()
{
if (m_widgetBuilder != null)
{
Workspace.Components.Unregister(m_widgetBuilder);
}
}
}- About the Workspace SDK: Workspace SDK architecture and module lifecycle.
- About components: The component registry and registration lifecycle.
- About workspace modules: Workspace module class and Load/Unload lifecycle.
- About Workspace SDK certificates: Certificate requirements for workspace components.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- ASP.NET hosting
- SDK compatibility
- Migrating to modern .NET
- Entities
- Entity cache
- Entity loading, cache, and query options
- Detecting entity changes
- Entity change event reference
- Transactions
- Security Center events
- Actions
- Security Desk
- Custom events
- Event-to-actions
- Managing macros
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- Entity write restrictions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Ingesting third-party video
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- About incidents
- Maps
- Logging
- Overview
- Localization
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- Modern .NET support
- Overview
- Localization
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Custom actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- Media file formats
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Endpoints
- Constants
- Enumerations
- Under the hood
- Troubleshooting