Skip to content

MVUX properties not visible to x:Bind TwoWay #18710

Closed

Description

@mikernet

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

Activity

  1. added
    difficulty/tbd
    kind/bug
    triage/untriaged
    on Nov 6, 2024
  2. added
    area/mvux
    and removed
    triage/untriaged
    difficulty/tbd
    on Nov 6, 2024
  3. dr1rrb commented on May 20, 2025

    @dr1rrb
    Member

    Context

    When the XAML generator runs (and tries to resolve the x:Bind path) it is not able to find properties generated by other generators (the MVUX generator in this case). In one-way binding we just generate the code, ignoring the fact the path resolution failed (and let the build fail later if the path is invalid), but in 2-way we need to resolve the actual properties types to generate proper casting.

    Infer MVUX generated properties

    While for toolkit's MVVM inferring the generated properties is fairly easy (1 to 1, same type), for MVUX it's quite more complicated. It would require to clone a significant amount of code from the MVUX's generator, and -worst- would cause an implicit dependency from uno to extension (if the generated properties evolve at some point) ... which is really not optimal.

    Linked issues:

    As we will try to not go that way and instead find a solution that also covers other linked issues, I'm closing this issue for now. We can revisit later.

  4. added theissue type on Jun 20, 2025
  5. removed
    kind/bug
    on Jun 22, 2025
  6. github-actions commented on May 6, 2026

    @github-actions
    Contributor

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests.

  7. locked as resolved and limited conversation to collaborators on May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mvux

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions