- Home
- Forum
- Xamarin.Forms
- Is MVVM with Custom Control binding available?
Is MVVM with Custom Control binding available?
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");
}
}
SIGN IN To post a reply.
8 Replies
EM
Emil
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");
}
}
HM
Hemalatha Marikumar
Syncfusion Team
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.
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 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....
RG
Rajkumar Ganesamoorthy
Syncfusion Team
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: https://www.syncfusion.com/downloads/support/forum/127500/ze/RotatorItemTemplate-781483886
Regards,
Rajkumar G
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: https://www.syncfusion.com/downloads/support/forum/127500/ze/RotatorItemTemplate-781483886
Regards,
Rajkumar G
JC
Joe Chavez
March 19, 2017 09:58 PM UTC
This code in the sample you provided does not even compile.
RK
Rathana Kumar Sekar
Syncfusion Team
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.
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.
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
This example has not the URI source for the image, neither FFImageLoading.
DR
Dhanasekar R
Syncfusion Team
December 24, 2018 12:45 PM UTC
Hi Christian,
Sorry for the inconvenience.
Based on your requirement we have prepared the sample in the MVVM pattern to show the image from the URL. Please have the sample from the below link.
Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/RotatorSample-1127232813
Regards,
Dhanasekar
SIGN IN To post a reply.
- 8 Replies
- 8 Participants
-
EM Emil
- Nov 19, 2016 04:17 PM UTC
- Dec 24, 2018 12:45 PM UTC