Skip to content

Wrong signature for FlyoutBase events #2434

Closed

Description

@slimCODE

Current behavior

Uno's FlyoutBase.Opening, FlyoutBase.Opened and FlyoutBase.Closed events have the EventHandler signature, while UWP's FlyoutBase have EventHandler<object>.

Expected behavior

Though you can discuss the poor design decision of choosing EventHandler<object>, Uno should have followed that signature.

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

  • Create a new Uno application
  • Add a MenuFlyout somewhere.
  • Handle the Opening event with Observable.FromEventPattern
             Observable
                 .FromEventPattern<object>(
                     h => myMenu.Opening += h,
                     h => myMenu.Opening -= h)
                 .Subscribe(_ => { });
    
  • Compile for all platforms

Result: It only compiles for UWP. On other platforms, you get error CS0029: Cannot implicitly convert type 'System.EventHandler' to 'System.EventHandler'.

Environment

Nuget Package: 2.0.528

Affected platform(s):

  • iOS (assumed)
  • Android
  • WebAssembly
  • macOS (assumed)
  • Windows
  • Build tasks
  • Solution Templates

Visual Studio:

  • 2017 (version: )
  • 2019 (version: 16.4.2)
  • for Mac (version: )

Activity

  1. added
    kind/bug
    triage/untriaged
    on Jan 4, 2020
  2. jeromelaban commented on Jan 4, 2020

    @jeromelaban
    Member

    Thanks Martin :) That's indeed not a discussion we're having 😂 I'll add reference this issue in #2240 that will be used to adjust signatures.

    In the meantime, the HAS_UNO define can be used to discriminate APIs in user code.

  3. added this to the 3.1 milestone on Aug 29, 2020
  4. removed
    triage/untriaged
    on Aug 29, 2020
  5. removed this from the 3.1 milestone on Aug 31, 2020
  6. added
    project/navigation-lifecycle 🧬
    on Sep 21, 2020
  7. added
    difficulty/tbd
    on Feb 15, 2021
  8. added
    difficulty/starter 🚀
    and removed
    difficulty/tbd
    on Jun 1, 2021
  9. Youssef1313 commented on Oct 16, 2021

    @Youssef1313
    Member

    Fixed in 1ab5f89.

    @jeromelaban @ebariche Can we close?

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/bugproject/navigation-lifecycle 🧬

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions