Skip to content

[x:True x:False] Clarify where the x extensions for true or false are available #20928

Open

Description

@DevTKSS

What would you like clarification on? 🤔

  • in which properties or elements are they usable?
x.true.false.mp4

Image

It seems like they are not available in TargetNullValue or FallbackValue of xaml, where they migh make sense like in the example. lets say the button should only be enabled if the textbox is not empty, but for such "easy" Task you might rather not want to use just for this codebehind. that would be in my opinion a good usecase for it. but the compiler is other opinion...

Concern 📚

Developing with Uno 🛠️

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

No response

Any feedback? 💬

Repro so you can check out that this is not working yourself
UnoApp-xTrue-xFalse Smallrepro.zip

#19155 @jeromelaban @MartinZikmund
sorry for taking so long, I just forgot about it and stamped it for myself as not usable.
Seems like its only available in the direct Bind function but not for those Values to be set. I was thinking about this as workaround for the Navigator providing the DataContext not at the point where it is bound and the SourceGen Roslyn issue. I can not change those, but I were hoping that would be usable without codebehind...

Activity

  1. added
    triage/untriaged
    difficulty/tbd
    on Jul 2, 2025
  2. MartinZikmund commented on Jul 7, 2025

    @MartinZikmund
    Member

    The rule of thumb would be whether the same does work in WinUI or not. If yes, then we might have discrepancy

  3. DevTKSS commented on Jul 7, 2025

    @DevTKSS
    ContributorAuthor

    @MartinZikmund hm okay, but from your knowledge, can you tell if you would even be expecting that these x Variables would be available at those parts of a binding like an x:String or not?
    You mentioning the WinUI but from what I did understand is that this is a Uno Specific (at least its listed as such in the docs?) so I would not expect a non uno WinUI app to provide those 🤔

  4. added
    difficulty/starter 🚀
    and removed
    triage/untriaged
    difficulty/tbd
    on Oct 16, 2025
  5. Jen-Uno commented on Mar 6, 2026

    @Jen-Uno
    Contributor

    Validation update (2026-03-05): I reviewed this on branch fix/algolia-docsearch-duplicates-and-layout (PR #22789). This issue still persists / is not resolved by the current branch changes. Tracking and consolidation: #22788.

  6. MartinZikmund commented on May 18, 2026

    @MartinZikmund
    Member

    Confirmed after looking at our source generator: in Uno (matching WinUI/UWP), x:True, x:False and x:Null are recognized only as literal parameters inside {x:Bind ...} function calls (e.g. {x:Bind MyFunc(x:False)}). They are not general-purpose boolean markup extensions and cannot be used in FallbackValue, TargetNullValue, or anywhere else a property accepts a value - WinUI behaves the same way, so this is not an Uno-specific limitation. The docs page does list this only under the x:Bind function parameters section, but I agree it could be made more explicit. Keeping this open with the kind/documentation label so we can tighten the wording to clarify that these are scoped to x:Bind function arguments.

  7. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  8. added
    stale
    on Oct 31, 2026
  9. removed
    stale
    on Nov 1, 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

    difficulty/starter 🚀kind/documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions