Communit Maui Toolkit 11.2.0 - EventName="Appearing" not working in .Net 9.0

Rakesh Gupta 10 Reputation points
2025-05-01T04:57:06.8366667+00:00

MAUI:

I have a login view and have Appearing event binded as show in below xaml code.

<ContentPage.Behaviors>

<toolkit:EventToCommandBehavior Command="{Binding LoginViewAppearingCommand}" EventName="Appearing" />

</ContentPage.Behaviors>

It works fine when Project have .net 8.0 and Community Maui toolkit 9.1.1. But when I upgrade to .net 9.0 with Community Maui toolkit 11.2.0 and Maui Controls 9.0.60 then it's not working.

Please suggest the solutions for it.

thanks

Developer technologies | XAML
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Carlos Zamora 0 Reputation points
    2025-05-23T16:41:44.9433333+00:00

    Hi Rakesh Gupta, you need to manually assign the BindingContext within your EventToCommandBehavior, for example:

    <toolkit:EventToCommandBehavior Command="{Binding LoginViewAppearingCommand}" EventName="Appearing" BindingContext="{Binding Source={x:Reference YourPageName}, Path=BindingContext}" />

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.