You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: ElementName binding inside a template is falsely reported as an error (WXAML0027) #351
{Binding ElementName=X} inside a DataTemplate or ControlTemplate that targets a named element outside the template is reported as an Error, although it compiles and works at runtime.
To Reproduce
In a page, add <TextBox x:Name="T" Text="outer-text"/>.
Add a ListView with <DataTemplate><TextBlock Text="{Binding Text, ElementName=T}"/></DataTemplate>.
See WXAML0027 No element named 'T' is visible in this XAML namescope.
Expected behavior
No diagnostic. dotnet build succeeds and the binding resolves at runtime.
Notes
Bug bash ID: C-05 (P1).
Screenshots
No response
OS Version and details
Windows 11 x64 (10.0.26200), VS Code 1.143.1, .NET SDK 10.0.403. Found in the XAML IntelliSense bug bash on 0.3.1-prerelease.456 (PR #276, f90df977).
Activity