Skip to content

Projection of XamlUICommand.CanExecuteChanged (system XAML) loses generic type #597

Closed

Description

When projecting Windows.UI.Xaml.Input.XamlUICommand, the CanExecuteChanged event is projected as EventHandler instead of EventHandler<T> causing a compile break ("XamlUICommand cannot implement ICommand because the type of CanExecuteChanged is different" or something like that)

Using the latest cswinrt nuget: 1.1.0-prerelease.201111.6

Activity

  1. changed the title [-]Projection of XamlUICommand (system XAML) loses generic type[/-] [+]Projection of XamlUICommand.CanExecuteChanged (system XAML) loses generic type[/+] on Nov 20, 2020
  2. asklar commented on Dec 2, 2020

    @asklar
    MemberAuthor

    CC Manodasan Wignarajah (@manodasanW) Kenny Kerr (@kennykerr) is this known / could you take a look?

  3. nesherhh commented on Mar 28, 2021

    @nesherhh

    Same problem with cswinrt nuget: 1.1.4.
    This one is related: #112

  4. manodasanW commented on Apr 5, 2021

    @manodasanW
    Member

    Daniels Danilins (@nesherhh) Can you expand on the scenario that you are hitting this in? Are you trying to use inbox XAML rather than WinUI similar to the original filer?

  5. nesherhh commented on Apr 5, 2021

    @nesherhh

    Yes. Inbox Windows.UI.Xaml.Input.XamlUICommand.CanExecuteChanged

  6. angelazhangmsft commented on Apr 5, 2021

    @angelazhangmsft
    Contributor

    Daniels Danilins (@nesherhh) currently building inbox XAML projections is not prioritized. What scenario are you trying to use this in - UWP?

  7. asklar commented on Apr 5, 2021

    @asklar
    MemberAuthor

    FYI this would be an important scenario for React Native for Windows, we would love to be able to adopt CsWinRT.

  8. 11 remaining items

  9. asklar commented on Apr 6, 2021

    @asklar
    MemberAuthor

    System XAML will activate fine, there are just bugs like this one, as well as the hard-coded mapping of certain .net types to WinUI 3 types (like IPropertyChanged*).

    In our scenario we are not ever using any bindings so we don't need the mappings, we just need the code to compile, so we would like CsWinRT to fix this simple XamlUICommand projection bug

  10. nesherhh commented on Apr 28, 2021

    @nesherhh

    Alexander Sklar (@asklar) did you found a workaround or fix?

  11. asklar commented on Apr 28, 2021

    @asklar
    MemberAuthor

    the only workaround is to produce the projection, and edit it by hand

  12. nesherhh commented on May 3, 2021

    @nesherhh

    Thanks, this worked. Now I'm able to use Xaml Islands on .NET 5.
    WindowsXamlHost and MapControl are running in the Microsoft.Toolkit.Sample.Wpf.App project.
    Because of #39 I had to comment bind for style property.
    Only issue I have now is UWP App (with XamlApplication) has to be c++/winrt project. As soon as I access any UWP class in C# UWP project I get PlatformNotSupported exception. Any other custom class in UWP project can be used without problem.

  13. nesherhh commented on May 23, 2021

    @nesherhh
  14. angelazhangmsft commented on Jan 13, 2022

    @angelazhangmsft
    Contributor

    Duplicate of #723

  15. mcooley commented on Jan 26, 2022

    @mcooley
    Member

    A fix for this issue would be useful to me, even independently of the full system XAML scenario that #723 is tracking.

    Here's my scenario: I'm building a command-line tool that uses Win2D. My tool doesn't use XAML, but the version of Win2D I want to use depends on System XAML. I'd like to use cswinrt to generate bindings for Win2D, but I can't because it pulls in XAML types that hit this bug. The XAML bindings don't actually need to work in my scenario, but it would be super helpful if they at least compiled.

  16. asklar commented on Mar 7, 2022

    @asklar
    MemberAuthor

    angelazhangmsft, Matt Cooley (@mcooley) has coded up a low risk fix that will unblock the scenario. It should have no negative impact on anything winappsdk related, so I would like for us to take it.

  17. added
    fixedIssue has been fixed in an upcoming or existing release
    on Mar 15, 2022
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

    bugSomething isn't workingfixedIssue has been fixed in an upcoming or existing release

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions