microsoft / XamlBehaviors

This is the official home for UWP XAML Behaviors on GitHub.
MIT License
692 stars 110 forks source link

WinUI Compatibility #225

Closed JeganRavichandran closed 2 years ago

JeganRavichandran commented 2 years ago

https://github.com/microsoft/XamlBehaviors/issues/192 is this resolved?

It looks like event to command is not working https://www.nuget.org/packages/Microsoft.Xaml.Behaviors.WinUI.Managed/

CommunityToolkit/WindowsCommunityToolkit#4448

michael-hawker commented 2 years ago

@JeganRavichandran are you using the latest package versions and Visual Studio versions? These things should be working?

Can you provide a minimal project that reproduces the issue?

FYI @DVaughan @azchohfi

michael-hawker commented 2 years ago

May be a duplicate of https://github.com/microsoft/XamlBehaviors/issues/221

JeganRavichandran commented 2 years ago

@michael-hawker @DVaughan @azchohfi

Please refer to this simple demo. Branch: https://github.com/SyncfusionExamples/Multiple-selection-made-easy-using-WinUI-ComboBox-control/tree/225-XamlBehavior-integration MR: https://github.com/SyncfusionExamples/Multiple-selection-made-easy-using-WinUI-ComboBox-control/pull/1

Expected: OnInputSubmitted method in ViewModel should be called when the control is loaded.

            <Interactions:EventTriggerBehavior EventName="Loaded">
            <!--<Interactions:EventTriggerBehavior EventName="InputSubmitted">-->
                <Interactions:InvokeCommandAction Command="{Binding InputSubmitted}"/>
                <!--<Interactions:CallMethodAction MethodName="OnInputSubmitted" TargetObject="{Binding}"/>-->
            </Interactions:EventTriggerBehavior>

Issue: OnInputSubmitted method in ViewModel is not called when the control is loaded.

I am getting this error in the output window.

Exception thrown at 0x74F2B5B2 (KernelBase.dll) in MultiselectComboBox.exe: 0x40080202: WinRT transform error (parameters: 0x8000000B, 0x80070490, 0x00000014, 0x02F7BF74).

JeganRavichandran commented 2 years ago

It looks like I missed adding within Behaviors attached property.

<Interactivity:Interaction.Behaviors>

event to commands works after adding this.