microsoft / microsoft/microsoft-ui-xaml

Cannot {x:Bind} to property of named non-control in C++/WinRT

Open
#10,130 3 comments 0 reactions 0 assignees View on GitHub
area-Binding area-C++/WinRT bug team-Core
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

Related to #2721, that issue is fixed, we can now bind to a property of a named control, but binding to named non-control is still causing compile error (you still need to redeclare it in the `idl`).

### Steps to reproduce the bug

1. Create a new C++ winui3 project
2. In `MainWindow.xaml`, use this xaml
```xml







```

### Expected behavior

_No response_

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

### Windows version

_No response_

### Additional context

[Repro](https://github.com/HO-COOH/WinUI-Bug/tree/main/21-xBindToNonControl)

Contributor guide

Open the contributing guide

Research direction

Start with the minimal repro in MainWindow.xaml and compare its named non-control x:Bind path with the named-control case fixed in #2721. Reproduce the C++/WinRT compile error using the linked project; done means the binding compiles without requiring the non-control to be redeclared in IDL.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.