Skip to content

[XAML Hot Reload] Editing StringFormat on an x:Reference binding clears the live value #37889

Closed

Description

@StephaneDelcroix

Description

With source-generated XAML Hot Reload enabled, changing only the StringFormat of an x:Reference-sourced binding can clear the live binding value after an earlier accepted edit. The value becomes empty instead of being reformatted or remaining stale.

Internal tracking: DevDiv 3049807

Steps to Reproduce

  1. Target .NET 11 Preview 7 / MAUI Preview 7 on WinUI and enable SourceGen XAML inflation and Hot Reload.
  2. Render two live instances of a ContentView containing:
    <Label x:Name="CaptionLabel" Text="Instance caption V0" />
    <Label Text="{Binding Source={x:Reference CaptionLabel}, Path=Text, StringFormat='echo {0}'}" />
  3. Run under dotnet watch and verify both instances show echo Instance caption V0.
  4. Change the caption to Instance caption V1, save, and verify both instances update.
  5. Change only StringFormat='echo {0}' to StringFormat='mirror {0}' and save.

Expected Behavior

Both live instances show mirror Instance caption V1.

Actual Behavior

The update is reported as applied, but the formatted binding value is empty.

Version with bug

.NET 11 Preview 7 / MAUI Preview 7 with SourceGen XAML inflation and Hot Reload enabled.

Affected platforms

Windows was verified. The affected path appears to be cross-platform generated binding-update code.

Related issues

None of those issues currently tracks this binding replacement/clearing behavior directly.

Activity

  1. added
    t/bug
    area-xaml
    area-tooling
    partner/hot-reload-xaml
    on Aug 27, 2026
  2. added
    s/triaged
    on Aug 27, 2026
  3. added a commit that references this issue on Sep 3, 2026
    c6608b5
  4. github-actions commented on Sep 3, 2026

    @github-actions
    Contributor

    Closed by #37895 (merged to net11.0). GitHub only auto-closes for PRs merged to the default branch; this issue was fixed by a PR merged to a non-default branch.

  5. locked and limited conversation to collaborators on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-toolingarea-xamlpartner/hot-reload-xamlplatform/windowss/triagedt/bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions