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

MVUX properties not visible to x:Bind TwoWay #18710

Open
mikernet opened this issue Nov 6, 2024 · 0 comments
Open

MVUX properties not visible to x:Bind TwoWay #18710

mikernet opened this issue Nov 6, 2024 · 0 comments
Labels
area/mvux Categorizes an issue or PR as relevant to MVU-X kind/bug Something isn't working

Comments

@mikernet
Copy link
Contributor

mikernet commented Nov 6, 2024

Current behavior

MVUX bindable view model properties are source-generated, so they aren't visible to the Uno source generator that compiles two-way XAML x:Bind code, similar to how MVVM toolkit generated observable properties were not visible until a workaround for that was implemented.

As soon as you go from:

<TextBox Text="{x:Bind Model.Name}" />

To

<TextBox Text="{x:Bind Model.Name, Mode=TwoWay}" />

Where Model is a bindable MVUX view model, you get:

error UXAML0001: Unable to find member [Name] on type [MainViewModel]

Expected behavior

MVUX bindable model properties should be inferred from their model for the XAML source generator, similar how MVVM toolkit generated observable properties are inferred from their fields to allow for two-way x:Bind.

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

No response

Workaround

Use Binding instead of x:Bind

Works on UWP/WinUI

None

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

5.4.10, 5.5.

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@mikernet mikernet added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Nov 6, 2024
@MartinZikmund MartinZikmund added area/mvux Categorizes an issue or PR as relevant to MVU-X and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mvux Categorizes an issue or PR as relevant to MVU-X kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants