microsoft / microsoft/microsoft-ui-xaml
Binding to a control name does not work in C++
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
Binding a `TextBlock.Text` property to a `x:Name` named control works in C#, but not in C++.
### Steps to reproduce the bug
1. Create a new winui3 project, under `MainWindow.xaml`
2. Use this xaml
```xml
```
In C# project, the text is correctly shown, not in C++

### Expected behavior
_No response_
### Screenshots
_No response_
### NuGet package version
WinUI 3 - Windows App SDK 1.7.3: 1.7.250606001
### Windows version
Windows 11 (24H2): Build 26100
### Additional context
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the binding in MainWindow.xaml using a WinUI 3 C++ project, then compare it with the equivalent C# project. Investigate the binding path from ElementName=MyButton to the TextBlock and verify that the displayed value is MyButton.Name when the issue is fixed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100