Skip to content

[Android/iOS] Using TemplateBinding in the Command parameter of a MenuFlyoutItem doesnt work #9059

Closed

Description

@thierry-fortin1

Current behavior

Using a TemplateBinding in the Command parameter of a MenuFlyoutItem, in the Style of a custom Control, doesnt work.
menuflyoutitemtemplatebindingANDROID
TemplateBinding is used here so we can reuse this Style at multiple places in the code by giving a different command everytime.
image
We use it here and give it the CustomCommand command we made in the logic Class.
image
We see what our CustomCommand does, it modifies the page's TextBlock when the MenuFlyoutItem is clicked.
image
image

Expected behavior

Should do the same thing UWP currently does:
menuflyoutitemtemplatebindingUWP

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

Open the sample app.
Click the button.
Click the first MenuFlyoutItem (choice 1).
Notice there is text appearing above the button on UWP, but not iOS/Android.

Workaround

Placing the MenuFlyout style (and its MenuFlyoutItems) directly in the Xaml page where it is used.
In this case, moving everything that is inside the ControlTemplate (Button -> Button.Flyout -> his 2 MenuFlyoutItem) directly inside the main grid of the app, so not using the custom control.

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia, Uno.UI.RemoteControl / Uno.WinUI.RemoteControl

NuGet package version(s)

4.3.8

Affected platforms

iOS, Android

IDE

Visual Studio 2022

IDE version

17.1.6

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    kind/bug
    platform/android 🤖
    platform/ios 🍎
    triage/untriaged
    difficulty/tbd
    on Jun 15, 2022
  2. changed the title [-][Uno] [Android/iOS] [MenuFlyoutItem] Using TemplateBinding in the Command parameter of a MenuFlyoutItem doesnt work #406[/-] [+][Android/iOS] Using TemplateBinding in the Command parameter of a MenuFlyoutItem doesnt work[/+] on Jun 15, 2022
  3. added
    project/binding 🪢
    on Jun 15, 2022
  4. jeromelaban commented on Jun 15, 2022

    @jeromelaban
    Member

    Likely related to #1621

  5. removed
    triage/untriaged
    on Dec 2, 2022
  6. self-assigned this
    on Jul 28, 2023
  7. added
    project/layout 🧱
    difficulty/challenging 🤯
    low-hanging-🍒
    and removed
    difficulty/tbd
    on Jul 31, 2023
  8. Xiaoy312 commented on Jul 16, 2024

    @Xiaoy312
    Contributor

    fixed by #9452

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/challenging 🤯kind/buglow-hanging-🍒platform/android 🤖platform/ios 🍎project/binding 🪢project/layout 🧱

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions