0
votes

I have a Syncfusion SfRating control on my xamarin forms view. I want to handle ValueChanged event in Prism ViewModel.

XAML :

xmlns:rating="clr-namespace:Syncfusion.SfRating.XForms;assembly=Syncfusion.SfRating.XForms"
xmlns:b="clr-namespace:Prism.Behaviors;assembly=Prism.Forms"

    <rating:SfRating ItemSize="40" ItemSpacing="15" HorizontalOptions="CenterAndExpand">
        <rating:SfRating.RatingSettings>
            <rating:SfRatingSettings RatedFill="Yellow"/>
        </rating:SfRating.RatingSettings>

        <rating:SfRating.Behaviors>
            <b:EventToCommandBehavior EventName="ValueChanged" EventArgsParameterPath="Value" Command="{Binding RatingValueChanged}" />
        </rating:SfRating.Behaviors>
    </rating:SfRating>

But an Exception accurs : System.ArgumentException: Expression of type 'Syncfusion.SfRating.XForms.ValueEventArgs' cannot be used for parameter of type 'System.EventArgs' of method 'Void Invoke(System.Object, System.EventArgs)' Parameter name: arg1

What's wrong? How can I send ValueChangedEventArgs e parameter of event to command?

1

1 Answers

0
votes

The reported issue with SfRating is due to ValueChangedEventArgs that is not inheritted from EventArgs. We have already fixed the issue and the new version with the fix will be rolled out by the end of August 2018.

Note: I'm working for Syncfusion.

Regards, Paul Anderson