You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Projection of XamlUICommand.CanExecuteChanged (system XAML) loses generic type #597
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
changed the title [-]Projection of XamlUICommand (system XAML) loses generic type[/-][+]Projection of XamlUICommand.CanExecuteChanged (system XAML) loses generic type[/+]on Nov 20, 2020
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?
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
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.
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.
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.
Activity
[-]Projection of XamlUICommand (system XAML) loses generic type[/-][+]Projection of XamlUICommand.CanExecuteChanged (system XAML) loses generic type[/+]asklar commentedon Dec 2, 2020
CC Manodasan Wignarajah (@manodasanW) Kenny Kerr (@kennykerr) is this known / could you take a look?
nesherhh commentedon Mar 28, 2021
Same problem with cswinrt nuget: 1.1.4.
This one is related: #112
manodasanW commentedon Apr 5, 2021
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?
nesherhh commentedon Apr 5, 2021
Yes. Inbox Windows.UI.Xaml.Input.XamlUICommand.CanExecuteChanged
angelazhangmsft commentedon Apr 5, 2021
Daniels Danilins (@nesherhh) currently building inbox XAML projections is not prioritized. What scenario are you trying to use this in - UWP?
asklar commentedon Apr 5, 2021
FYI this would be an important scenario for React Native for Windows, we would love to be able to adopt CsWinRT.
11 remaining items
asklar commentedon Apr 6, 2021
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
nesherhh commentedon Apr 28, 2021
Alexander Sklar (@asklar) did you found a workaround or fix?
asklar commentedon Apr 28, 2021
the only workaround is to produce the projection, and edit it by hand
nesherhh commentedon May 3, 2021
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.
nesherhh commentedon May 23, 2021
I just leave it here https://github.com/nesherhh/XamlIslandsNET5
angelazhangmsft commentedon Jan 13, 2022
Duplicate of #723
mcooley commentedon Jan 26, 2022
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.
asklar commentedon Mar 7, 2022
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.