What problem does it solve?
When building a Reactor app you often need a control that has no built-in factory — a Windows Community Toolkit control, a third-party vendor control, or your own custom Control subclass. Writing the wrapper, handler, and registration code by hand is repetitive and error-prone. This Skill turns any such control into a first-class declarative Reactor element from a single annotated partial record, with zero hand-written wrapper code.
Core Features & Use Cases
- Source-generated wrappers: Annotate an empty partial record with [GenerateReactorWrapper(typeof(T))] and the generator emits init-props, the ControlDescriptor, Pattern-A registration, and a factory named after the control.
- Auto-inference: Props, content slots, panel children, ItemsControl items, two-way value/event pairs, and event callbacks are inferred automatically; [Wrap*] attributes ([WrapControlled], [WrapAlias], [WrapContent], [WrapEvent], [WrapLifecycle], [WrapElementSlot], and more) cover non-conventional cases.
- Imperative lifecycle support: [WrapLifecycle] runs mount/unmount methods (e.g. CameraPreview.StartAsync) so call sites stay purely declarative.
- Use Case: Wrap the CommunityToolkit Segmented control whose SelectedIndex changes through SelectionChanged by adding [WrapControlled("SelectedIndex", ChangedEvent = "SelectionChanged")], then consume it as Segmented(selectedIndex: idx, onSelectedIndexChanged: setIdx, items: ...).
Quick Start
Wrap the CommunityToolkit SettingsCard control as a declarative Reactor element using the GenerateReactorWrapper source generator and show me how to use it in a component.