Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use element name for Binding inside a Flyout #16743

Open
eriklimakc opened this issue May 15, 2024 · 1 comment
Open

Can't use element name for Binding inside a Flyout #16743

eriklimakc opened this issue May 15, 2024 · 1 comment
Assignees
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working project/binding 🪢 Categorizes an issue or PR as relevant to the binding engine triage/untriaged Indicates an issue requires triaging or verification

Comments

@eriklimakc
Copy link
Contributor

Current behavior

Works on Windows.

When trying to Bind a command from the Page ViewModel to a MenuFlyout that is inside an ItemTemplate using ElementName, the bind doesn't work.

Expected behavior

No response

How to reproduce it (as minimally and precisely as possible)

Repro app: Flyout.zip

Workaround

No response

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

"Uno.Sdk": "5.2.121"
<UnoExtensionsVersion>4.1.21</UnoExtensionsVersion>
<UnoToolkitVersion>6.0.18</UnoToolkitVersion>
<UnoThemesVersion>5.0.13</UnoThemesVersion>
<UnoCSharpMarkupVersion>5.2.14</UnoCSharpMarkupVersion>

Affected platforms

WebAssembly, Android, Skia (WPF)

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@eriklimakc eriklimakc added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels May 15, 2024
@Xiaoy312 Xiaoy312 added the project/binding 🪢 Categorizes an issue or PR as relevant to the binding engine label May 24, 2024
@Youssef1313 Youssef1313 self-assigned this May 31, 2024
@Youssef1313
Copy link
Member

That's tricky to fix. When evaluating ElementName, we should be checking the current NameScope as well as the TemplatedParent NameScope.

Currently, we only check the current NameScope. To properly check the TemplatedParent's NameScope, we'll need #12732. Then, after this line:

var target = NameScope.FindInNamescopes(_view?.Target as DependencyObject, elementNameSubject.Name);

we should have target ??= NameScope.FindInNamescopes((_view?.Target as DependencyObject)?.TemplatedParent, elementNameSubject.Name);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working project/binding 🪢 Categorizes an issue or PR as relevant to the binding engine triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

3 participants