| name | widget-creation |
| description | Create new desktop widgets for the 3SC WPF widget host. Use when adding a new widget type or instance, including its domain model, persistence, viewmodel, view, and registration in the shell/launcher flow. |
Widget Creation
Overview
Define, implement, and register widgets consistently across domain, data, UI, and tests.
Constraints
- .NET 8 WPF
- MVVM with CommunityToolkit.Mvvm
- Use shared styles/resources; avoid widget-specific hardcoded colors
- Persist widget instances in SQLite via repositories
Workflow
- Add domain artifacts:
- Ensure a
Widgetentry exists for the type. - Add or update
WidgetInstanceusage for placements.
- Ensure a
- Add application logic:
- Add a viewmodel for the widget.
- Add any commands or validation.
- Add UI artifacts:
- Create a view under
3SC/Viewsor3SC/Widgets/<WidgetName>/. - Bind to viewmodel properties; no code-behind logic.
- Create a view under
- Register the widget:
- Add to the widget picker viewmodel list.
- Create or update any factory/service to instantiate widgets.
- Persist widget state:
- Use repositories and unit of work for saves.
- Add tests:
- Domain invariants
- Viewmodel tests
- Repository integration tests when persistence is touched
Naming and layout
- Widget key:
clock,weather,notes - ViewModel:
<WidgetName>WidgetViewModel - View:
<WidgetName>WidgetView - Placement:
WidgetInstancewithWidgetPositionandWidgetSize
References
references/widget-checklist.mdfor creation checklist.references/registration.mdfor picker/registration guidance.