Skip to content

Commit dddb3f8

Browse files
docs: migrate doc templates + apps to renamed boolean modifiers (#268) (#342)
Migrates the remaining doc-pipeline templates, doc apps, and compiled guide pages to the WinUI-aligned boolean modifier names introduced in #296 / #268: .Visible -> .IsVisible .Disabled(x) -> .IsEnabled(!x) (inverted) .Selectable -> .IsTextSelectionEnabled .ReadOnly -> .IsReadOnly .Editable -> .IsEditable .Closable -> .IsClosable .Active -> .IsActive .DisabledFocusable -> .IsDisabledFocusable .LightDismiss -> .IsLightDismissEnabled The original PR migrated first-party code, samples, and a handful of doc apps. This sweep covers the rest: 8 remaining doc apps, 8 templates, and the 10 compiled guide pages that reference them. Compiled output regenerated with `mur docs compile` (recipes pages patched in place to preserve their inlined snippets). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c652b0d commit dddb3f8

26 files changed

Lines changed: 61 additions & 61 deletions

File tree

docs/_pipeline/apps/commanding/App.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public override Element Render()
199199
// Inline button — Command<T> doesn't have a Button(cmd, arg) overload
200200
// by design, so call .Execute(arg) directly from the click handler.
201201
Button(delete.Label, () => delete.Execute?.Invoke(item))
202-
.Disabled(!delete.IsEnabled)))
202+
.IsEnabled(delete.IsEnabled)))
203203
).Padding(24);
204204
}
205205
}

docs/_pipeline/apps/dialogs-and-flyouts/App.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public override Element Render()
176176
() => setOpen(!open)),
177177
Popup(popupContent, isOpen: open,
178178
onClosed: () => setOpen(false))
179-
.LightDismiss()
179+
.IsLightDismissEnabled()
180180
.Offset(120, 0)
181181
).Padding(24);
182182
}

docs/_pipeline/apps/forms/doc-manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ screenshots:
2121
region: client
2222
format: png
2323
- id: keep-submit-reachable
24-
description: "Form using .Immediate() on NumberBox and .DisabledFocusable() on Submit so keyboard users can always reach the button"
24+
description: "Form using .Immediate() on NumberBox and .IsDisabledFocusable() on Submit so keyboard users can always reach the button"
2525
component: KeepSubmitReachableDemo
2626
region: client
2727
format: png

docs/_pipeline/apps/recipe-login/App.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ error is null
5858
? Empty()
5959
: TextBlock(error).Foreground("#C42B1C"),
6060
Button(submitting ? "Signing in…" : "Sign in", () => _ = Submit())
61-
.Disabled(!canSubmit)
61+
.IsEnabled(canSubmit)
6262
).Padding(20).Width(320);
6363
// </snippet:render>
6464
}

docs/_pipeline/apps/recipe-multi-step-form/App.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ Element StepSummary() => VStack(8,
8787
Heading("Create your account"),
8888
body,
8989
HStack(8,
90-
Button("Back", () => setStep(step - 1)).Disabled(step == 0),
90+
Button("Back", () => setStep(step - 1)).IsEnabled(step != 0),
9191
Button(step == 2 ? "Submit" : "Next",
92-
() => setStep(step + 1)).Disabled(!canAdvance || step == 2)
92+
() => setStep(step + 1)).IsEnabled(canAdvance && step != 2)
9393
)
9494
).Padding(20).Width(380);
9595
// </snippet:render>

docs/_pipeline/apps/recipe-paginated-list/App.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public override Element Render()
110110
: Button(
111111
loadingMore ? "Loading more…" : $"Load more ({commits.EstimatedRemaining} remaining)",
112112
() => commits.FetchNext()
113-
).Disabled(loadingMore).Padding(8);
113+
).IsEnabled(!loadingMore).Padding(8);
114114

115115
return VStack(0,
116116
Heading($"Commits ({commits.TotalCount ?? loadedItems.Length})").Padding(20),

docs/_pipeline/apps/status-and-info/App.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ class InfoBarSeveritiesDemo : Component
1515
public override Element Render() => VStack(8,
1616
SubHeading("InfoBar — severity fluents"),
1717
InfoBar("Saving…", "Your changes are being written.")
18-
.Informational().Closable(false),
18+
.Informational().IsClosable(false),
1919
InfoBar("Saved", "Your changes were saved.")
20-
.Success().Closable(false),
20+
.Success().IsClosable(false),
2121
InfoBar("Slow connection",
2222
"Some assets may not load until the network recovers.")
23-
.Warning().Closable(false),
23+
.Warning().IsClosable(false),
2424
InfoBar("Save failed",
2525
"The destination drive is read-only.")
26-
.Error().Closable(false)
26+
.Error().IsClosable(false)
2727
).Padding(24);
2828
}
2929
// </snippet:infobar-severities>
@@ -47,7 +47,7 @@ public override Element Render()
4747
OnClosed = () => setOpen(false),
4848
Severity = Microsoft.UI.Xaml.Controls.InfoBarSeverity.Informational,
4949
},
50-
Button("Show again", () => setOpen(true)).Disabled(open)
50+
Button("Show again", () => setOpen(true)).IsEnabled(!open)
5151
).Padding(24);
5252
}
5353
}
@@ -106,7 +106,7 @@ public override Element Render() => VStack(12,
106106
// Determinate ring at 60%.
107107
ProgressRing(0.6).Width(48).Height(48),
108108
// Indeterminate spinner.
109-
ProgressRing().Active().Width(48).Height(48)
109+
ProgressRing().IsActive().Width(48).Height(48)
110110
).Padding(24);
111111
}
112112
// </snippet:progress-ring>

docs/_pipeline/apps/text-and-media/App.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TextBlockModifiersDemo : Component
2626
{
2727
public override Element Render() => VStack(8,
2828
TextBlock("Bold + sized").Bold().FontSize(18),
29-
TextBlock("Selectable so the user can copy.").Selectable(),
29+
TextBlock("Selectable so the user can copy.").IsTextSelectionEnabled(),
3030
TextBlock(
3131
"A long paragraph that demonstrates wrapping behavior. " +
3232
"Without TextWrapping, content stays on one line and is " +

docs/_pipeline/templates/accessibility.md.dt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ matches the stale handle and `args.Cancel = true` wedges focus on a
177177
neighboring page element. Always flip `isActive` to false in the same
178178
state batch that unmounts the container, or apply the trap to an
179179
element that stays in the tree across the open/closed transition
180-
(an always-mounted overlay with `.Visible(open)` rather than
180+
(an always-mounted overlay with `.IsVisible(open)` rather than
181181
`When(open, ...)`).
182182
<!-- /ai:caveat -->
183183

@@ -281,7 +281,7 @@ The standard accessible modal combines three primitives: a controlled
281281
`isOpen` boolean, a `UseFocusTrap` keyed on it, and a
282282
`UseAnnounce` that announces "Dialog opened" on first render and
283283
"Dialog closed" on dismiss. The trap container should stay mounted
284-
across the open/closed transition (use `.Visible(open)` not
284+
across the open/closed transition (use `.IsVisible(open)` not
285285
`When(open, ...)`) so focus is released cleanly when `isActive`
286286
flips false — see the caveat above. The
287287
[modal-dialog recipe](recipes/modal-dialog.md) wires all three end
@@ -311,17 +311,17 @@ keeps them keyboard- and pointer-interactive.
311311

312312
## Common Mistakes
313313

314-
### Disabled Submit with no `.DisabledFocusable()`
314+
### Disabled Submit with no `.IsDisabledFocusable()`
315315

316316
```csharp
317317
// Don't:
318-
Button("Submit", onSubmit).Disabled(!form.IsValid)
318+
Button("Submit", onSubmit).IsEnabled(form.IsValid)
319319
```
320320

321321
A disabled button is removed from the Tab order. The user fixes the
322322
last field, presses Tab to reach Submit, focus skips past the still-
323323
disabled button, and they're stranded with no keyboard route. Use
324-
`.DisabledFocusable(!form.IsValid)` on the button — it keeps the
324+
`.IsDisabledFocusable(!form.IsValid)` on the button — it keeps the
325325
button keyboard-focusable while presenting as disabled. The
326326
[Forms page](forms.md#keeping-submit-reachable) covers the full
327327
shape (it composes with `.Immediate()` on commit-on-blur inputs).
@@ -338,7 +338,7 @@ Button("Save", onSave)
338338
focus and pointer hit-testing still work. The result is a button the
339339
user can Tab to and click but a screen reader user cannot discover.
340340
If the control should not be exposed to assistive tech, it should
341-
not exist for keyboard users either; use `.Disabled(true)` or pull it
341+
not exist for keyboard users either; use `.IsEnabled(false)` or pull it
342342
from the tree with `When(...)`. Use `.AccessibilityHidden()` only on
343343
decorative elements that don't accept focus (icons, ornamental
344344
borders, redundant labels).

docs/_pipeline/templates/cheat-sheet.md.dt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Full coverage on [Controls](controls.md).
9191
| Text | `.FontSize(n)` `.Bold()` `.SemiBold()` `.Opacity(n)` |
9292
| Color | `.Background(token)` `.Foreground(token)` `.WithBorder(token, thickness?)` |
9393
| Shape | `.CornerRadius(n)` |
94-
| Behavior | `.Disabled(bool)` `.Visible(bool)` `.ToolTip(s)` |
94+
| Behavior | `.IsEnabled(bool)` `.IsVisible(bool)` `.ToolTip(s)` |
9595
| Keying | `.WithKey(s)` |
9696
| Flex | `.Flex(grow?, shrink?, basis?)` |
9797
| Themed | `.RequestedTheme(ElementTheme)` `.Backdrop(BackdropKind)` |
@@ -149,7 +149,7 @@ so the reconciler can move rows rather than rebuild them.
149149
the function-component cache holds it across parent re-renders.
150150

151151
**Disable submit during async work.** A single `submitting` bool
152-
covers both the button's `.Disabled(...)` and the spinner label.
152+
covers both the button's `.IsEnabled(...)` and the spinner label.
153153

154154
## Rules
155155

0 commit comments

Comments
 (0)