We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding events (ProgressCompleted) via prims EventToCommandBehaviour

Thread ID:

Created:

Updated:

Platform:

Replies:

144404 May 5,2019 10:45 AM UTC May 10,2019 10:59 AM UTC Xamarin.Forms 3
loading
Tags: SfProgressBar
Ian
Asked On May 5, 2019 10:45 AM UTC

Good day,

My requirement is to bind the ProgressCompleted event of a SfProgressBar (circular) to a prism delegate command.
So far I have managed to wire the Progress, SegmentCount and Maximum properties to the view model without problems.
Wiring the ProgressCompleted event using prisms EventToCommandBehaviour does not fire a command in the view model.
Catching the event in code behind does work but it is not the desired solution.

xaml:

<progressBar:SfCircularProgressBar.Behaviors>
            <b:EventToCommandBehavior
                EventName="ProgressCompleted"
                Command="ProgressCompletedEvent"
                CommandParameter="Complete"/>
        </progressBar:SfCircularProgressBar.Behaviors>

Kindly provide feedback wrt what the correct approach would be.

Warm regards

Sathish Sivakumar [Syncfusion]
Replied On May 6, 2019 12:34 PM UTC

Hi Ian, 
 
Greetings from Syncfusion. 
 
We have prepared a simple sample using prism framework to convert the event to command using EventToCommandBehaviour. We can see the command is triggered as expected for the ProgressCompleted event in SfCircularProgressBar. Please refer the sample in the below link. 
 
 
Kindly ensure that the command associated to ProgressCompleted event is properly bonded.  
 
Please modify the above sample if you are still facing the same issue. 
 
Regards, 
Sathish 


Ian
Replied On May 8, 2019 06:08 AM UTC

Good day Sathish,

Thank you for the response.
The sampled worked and I modified it to use Prism's DelegateCommand - worked as well.
The issue reoccurs as soon as the ViewModels constructor is not parameter-less with the BindingContext section in the xaml View file giving an error:

"Type xyzPageViewModel is not usable as an object element because it is not public or does not define a public parameterless  constructor or type converter"

Unfortunately, I cannot use a parameter-less constructor (I am using Prism's NavigationService) in my solution.

I have no idea how to fix this currently and will prepare a sample when time permits - (maybe I should look at a type converter?).

For now I will have to work around the issue of not being able to detect the event in the ViewModel.

Regards

Dilli Babu Nandha Gopal [Syncfusion]
Replied On May 10, 2019 10:59 AM UTC

Hi Ian, 

Thank you for your update. 

We request you to share us your sample in which the mentioned error was occurred and unable to use parameter less constructor so that we can modified the sample as per your requirement. 

Regards, 
Dilli babu. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon