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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is MVVM with Custom Control binding available?

Thread ID:

Created:

Updated:

Platform:

Replies:

127500 Nov 19,2016 04:17 PM UTC Mar 20,2017 12:22 PM UTC Xamarin.Forms 6
loading
Tags: SfRotator
Emil
Asked On November 19, 2016 04:17 PM UTC

I am using ffimageloading package which is inherited from Image control eventually. I try to bind string urls from Internet but it looks like it doesnt work. I tried the same with Image control also no chance. either problem with MVVM binding or urls from the web. You mentioned that July 2016 update will fix the problem that web images will work.



<ContentView.Content>
    <rotator:SfRotator x:Name="rotator"  Grid.Row="0" NavigationDelay="2000"  IsTextVisible="true"
                       ItemsSource="{Binding ImageCollection}" SelectedIndex="2" NavigationDirection="Horizontal"  EnableLooping="true"
                       NavigationStripMode="Dots" BackgroundColor="#ececec" NavigationStripPosition="Bottom"  EnableAutoPlay="true">
      <rotator:SfRotator.ItemTemplate>
        <DataTemplate>
          <ffimageloading:CachedImage  
WidthRequest="300" HeightRequest="300"
DownsampleToViewSize="true"
Source="{Binding Image}">         
        </DataTemplate>
      </rotator:SfRotator.ItemTemplate>
    </rotator:SfRotator>


  private List<RotatorModel> imageCollection = new List<RotatorModel>();
        public List<RotatorModel> ImageCollection
        {
            get { return imageCollection; }
            set { imageCollection = value;
            RaisePropertyChanged("ImageCollection");
 }
        }

Emil
Replied On November 19, 2016 09:59 PM UTC

Actually my problem is that binding works fine with the custom controls also But only works if Items are created in the viewmodel constructor. I am not able to 
re-bind imageCollection. how can I trigger binding it again? I tried using ObservableCollection and raising property changed on Image but it doesnt help.

<ContentView.Content>
    <rotator:SfRotator x:Name="rotator"  Grid.Row="0" NavigationDelay="2000"  IsTextVisible="true"
                       ItemsSource="{Binding ImageCollection}" SelectedIndex="2" NavigationDirection="Horizontal"  EnableLooping="true"
                       NavigationStripMode="Dots" BackgroundColor="#ececec" NavigationStripPosition="Bottom"  EnableAutoPlay="true">
      <rotator:SfRotator.ItemTemplate>
        <DataTemplate>
          <ffimageloading:CachedImage  
WidthRequest="300" HeightRequest="300"
DownsampleToViewSize="true"
 Source="{Binding Image}">         
        </DataTemplate>
      </rotator:SfRotator.ItemTemplate>
    </rotator:SfRotator>


  private List<RotatorModel> imageCollection = new List<RotatorModel>();
        public List<RotatorModel> ImageCollection
        {
            get { return imageCollection; }
            set { imageCollection = value;
            RaisePropertyChanged("ImageCollection");
 }
        }

Hemalatha Marikumar [Syncfusion]
Replied On November 21, 2016 10:45 AM UTC

Hi Emil,

Thanks for contacting Syncfusion Support.

Query: Not able to re-bind the image collection in Rotator control.

We have already provided support for getting Rotator’s images from Url location. Now the reported issue can be reproduced at our end. We have already logged defect report regarding this. We have created a new support incident under your account to track the status of your latest query. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Regards,
Hemalatha M.R.

uman
Replied On January 16, 2017 09:28 AM UTC

Hi Emil,

Thanks for contacting Syncfusion Support.

Query: Not able to re-bind the image collection in Rotator control.

We have already provided support for getting Rotator’s images from Url location. Now the reported issue can be reproduced at our end. We have already logged defect report regarding this. We have created a new support incident under your account to track the status of your latest query. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Regards,
Hemalatha M.R.

Hi Hemalatha,

you commented that "We have already provided support for getting Rotator’s images from Url location", where can i find support or example of how to achieve that? I am using ffimageloading package for showing the images, but i couldn't get images from uri... any help?!

thanks in Advance....

Rajkumar Ganesamoorthy [Syncfusion]
Replied On January 17, 2017 07:31 AM UTC

Hi Uman,

Thanks for contacting Syncfusion Support.

We have prepared sample to show demo on "How to show the image in SfRotator based on its uri location". Please find the sample from below

Sample: http://www.syncfusion.com/downloads/support/forum/127500/ze/RotatorItemTemplate-781483886

Regards,
Rajkumar G

Joe Chavez
Replied On March 19, 2017 09:58 PM UTC

This code in the sample you provided does not even compile.

Rathana Kumar Sekar [Syncfusion]
Replied On March 20, 2017 12:22 PM UTC

Hi Joe,

Thanks for contacting Syncfusion Support.

We have tested the sample and we are not facing any compile issues. So could you please add the particular nuget packs and SfRotator assemblies to that project and then compile.

if you facing the same issue again, could you please provide Stacktrace information or obtained error screenshot image. This will help us to provide appropriate solution on this.

Regards,
Rathanakumar S.


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.

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

;