Find Unresolved XAML Bindings
find_unresolved_bindingsDetect silently broken XAML bindings where the root member is missing from the resolved DataContext view-model. Use after renaming or removing view-model members to catch typos and stale bindings.
Instructions
List silently broken XAML bindings: a {Binding X} whose root member does NOT exist on its confidently resolved DataContext view-model (typo, removed/renamed member, or wrong DataContext) - neither the compiler nor render-smoke tests catch it.
Use it after renaming or removing view-model members. It judges the ROOT member of a binding path only. Where a member or a resource key is bound: find_binding_usages / find_resource_usages.
Covers WPF/WinUI .xaml (view-model via d:DesignInstance or a unique FooView->FooViewModel convention) and Avalonia .axaml ({Binding}/{CompiledBinding}, only via x:DataType). Conservative BY SKIPPING: a binding whose DataContext scope cannot be typed with certainty (ControlTemplate, any Style but the element's own inline one, runtime DataContext, keyed resources, a DataType-less template unless - WPF only - its host's ItemsSource types it), or whose view-model has an unverifiable external base, is never flagged. Source-generated ([ObservableProperty]/[RelayCommand]) and inherited members count as resolved. Two measured false-report classes are closed: a HierarchicalDataTemplate's ItemsSource pinned onto its content (8/8 on MahApps.Metro), and a d:DesignInstance hint where code-behind sets DataContext = this (25/25 on a ReactiveUI example; now skipped). A hit is evidence to verify at its line, not proof.
Returns JSON: count and unresolvedBindings (view, viewModel, member, line; one entry per site), plus markupFilesScanned and bindingSitesInMarkup from a live disk walk (a clean zero vs no markup at all). The denominator of count: sitesJudged (root member checked on a resolved type) and sitesSkipped, by reason in sitesSkippedBy (both null on a recalled session); judgementNote names any gap to bindingSitesInMarkup. sitesSkippedByView lists each view's skipped sites by reason with their lines (capped at 100 views): a renamed site listed there was never judged.
Read-only; LIVE analysis only: call refresh_session after edits (a recalled snapshot reports none, and a 'note' says so).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>"
},
"name": "find_unresolved_bindings"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use. |