New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Carousel, using x:Bind to an empty list breaks the control #1203
Comments
If anyone could come up with a solution until Wednesday night I would be very grateful, kind of in a hurry :-) |
@dusandjovanovic Carousel is to show images then what it will show without any images. My solution is to have a default image (Ex: AppLogo) in |
@Vijay-Nirmal When there are no images, then the control should just show no images. All list controls show an empty view when the list is empty. Delayed adding of content should not break the control, it is a very common scenario. |
Agree, that seems like a bug. @Mimetis, what do you think? |
I encountered a very similar issue |
@Vijay-Nirmal I tried to provide the app logo as default 1st image in my first object, but its still giving the same exception. Initialization in ViewModel Videos = new ObservableCollection XAML : <controls:Carousel x:Name="CarouselControl" |
Hi all; Be careful, in your code, you set the Here is my code (working with the correction added with this PR)
Mainpage.xaml.cs code :
|
I removed the selected index property and just bound it to an empty collection, and I am still getting the same error. I am binding it to a ViewModel property actually. |
Thanks for testing this @touseefbsb . I haven't had a chance to test it, did you try this with the PR (#1139) in progress? |
no I havent tested it with PR, I am using nuget package, can you please guide me how can I use PR version of the library? thanks |
I just tested it with the latest PR (binding to an empty collection) and seems to be working ok :) If you want to test it yourself, you can use the nugets generated from AppVeyor on that PR: https://ci.appveyor.com/project/dotnetfoundation/uwpcommunitytoolkit/build/1.5.1-PullRequest01139.7.build.1183/artifacts |
Hello, I have an observable collection of: private ObservableCollection Suggested { get; set; }
When I tried to bind carousel to this collection, which is initially empty, I get an error that a binding property is of invalid range (0 elements) as soon as I navigate the xaml page containing the carousel control.
Am I doing something wrong? My Observable collection of type "Movie" is being filled with API requests, but it's initially empty - The carousel control should be able to handle this kind of binding.
The text was updated successfully, but these errors were encountered: