Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] CarouselView.VisibleViews property was shared among with all carouselview #11826

Closed
myroot opened this issue Aug 18, 2020 · 1 comment · Fixed by #11827
Closed

[Bug] CarouselView.VisibleViews property was shared among with all carouselview #11826

myroot opened this issue Aug 18, 2020 · 1 comment · Fixed by #11827
Labels
a/carouselview in-progress This issue has an associated pull request that may resolve it! t/bug 🐛
Milestone

Comments

@myroot
Copy link
Contributor

myroot commented Aug 18, 2020

Description

CarouselView.VisibleViews should be provide for each carouselview, but a same VisibleViews was provided

According to this line, new ObservableCollection<View>() is provided by default value

static readonly BindablePropertyKey VisibleViewsPropertyKey = BindableProperty.CreateReadOnly(nameof(VisibleViews), typeof(ObservableCollection<View>), typeof(CarouselView), new ObservableCollection<View>());

But according to GetValue implementation

return context == null ? property.DefaultValue : context.Value;

It is sharing a static value (property.DefaultValue)

So, all carouselview has a same VisibleViews

Steps to Reproduce

  1. Create two CarouselView
  2. Compare each VisibleViews
var carouselView = new CarouselView();
var carouselView2 = new CarouselView();
Debug.Assert(carouselView.VisibleViews != carouselView2.VisibleViews);

Expected Behavior

Should not be same

Actual Behavior

Has same instance

Basic Information

  • Version with issue: 4.8.0
  • Last known good version: None
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

Workaround

@myroot myroot added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 18, 2020
@samhouts samhouts added this to New in Triage Aug 18, 2020
@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Aug 18, 2020
@samhouts samhouts added this to In Progress in .NET MAUI Backlog Aug 18, 2020
@samhouts samhouts removed this from In Progress in .NET MAUI Backlog Aug 18, 2020
@samhouts samhouts added this to In Progress in vCurrent (4.8.0) Aug 18, 2020
@samhouts samhouts moved this from In Progress to Done in vCurrent (4.8.0) Aug 21, 2020
@jsuarezruiz jsuarezruiz moved this from New to Ready For Work in Triage Aug 24, 2020
@jsuarezruiz jsuarezruiz removed the s/unverified New report that has yet to be verified label Aug 24, 2020
@samhouts samhouts moved this from Ready For Work to Needs Estimate in Triage Aug 24, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 25, 2020
@samhouts
Copy link
Member

closed by #11827

Triage automation moved this from Needs Estimate to Closed Aug 26, 2020
@samhouts samhouts removed this from Closed in Triage Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/carouselview in-progress This issue has an associated pull request that may resolve it! t/bug 🐛
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants