Giter VIP home page Giter VIP logo

Comments (25)

alexrainman avatar alexrainman commented on June 12, 2024 1

Your fix is almost ready!

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

Ooops let me fix that :)

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

I am also working on a fix for the widgets height issue :)

from carouselview.

dominik-weber avatar dominik-weber commented on June 12, 2024

Thank you for the quick response! Btw. if I initialize the control with an empty itemssource I get this exception:

Value does not fall within the expected range.

at Windows.UI.Xaml.Controls.Primitives.Selector.put_SelectedIndex(Int32 value)
at CarouselView.FormsPlugin.UWP.CarouselViewRenderer.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)
at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()

If I don't set the ItemsSource property at all I get a Null Reference exception:

at CarouselView.FormsPlugin.UWP.CarouselViewRenderer.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)
at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

Well, you suposed to pass something in the ItemsSource or you want a CarouselView with no views?

from carouselview.

dominik-weber avatar dominik-weber commented on June 12, 2024

I wanted to start with en empty CarouselView and add pages later on. What I'm trying to create is a hierarchical menu that starts empty and once it is initialized (asynchronously) the first page is added. When the user selects an item the sub menu page is added and navigated/scrolled to and so on.

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

Let my try to add that functionality, the thing is the FlipView need a selected index

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

By the way, thanks for using my control :)

from carouselview.

dominik-weber avatar dominik-weber commented on June 12, 2024

well, thank you for creating it! ;)

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

What about the same functionality on Android and iOS?

from carouselview.

dominik-weber avatar dominik-weber commented on June 12, 2024

I have not tested on android and ios yet.

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

You solution for this is completed. Unfortunately, i have to re-render each page again when screen is resized, but it's transparent for end user. I was able to keep the carousel position and, call rendering when screen resize is completed only.

I have to add one more detail for HeighRequest issue and i will ship version 2 :)

from carouselview.

dominik-weber avatar dominik-weber commented on June 12, 2024

works, thanks! 👍

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

Some changes are on the way like observable collection changed event to handle remove/add pages, slide to page changing position, a fix to allow indicators have transparent background. So, the methods to add/remove pages and set position will be gone soon.

from carouselview.

dominik-weber avatar dominik-weber commented on June 12, 2024

Sounds great ;) One thing I've noticed is when I resize the window the content now seems to be resized delayed. Is there a reason for this?

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

Its because to avoid multiple resizing, i have to put a timer and wait for the last resized event to trigger. I can lower the timer for next release.

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

SizeChanged is called multiple times, weird :(

from carouselview.

dominik-weber avatar dominik-weber commented on June 12, 2024

Ah, I see. What I'm not quite getting is why you have to rebuild the content every time the size changes. Wouldn't it be enough to apply/layout the new size?

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

I tried that but it didnt work. I still trying.

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

My experience with UWP is limited to this plugin, so i am doing my best to make it work in the right way. The only thing left is to avoid needing to rebuild the whole thing on resize.

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

I am really having hard times making this to work in the right way. SizeChanged is called multiple times and Timer is not working as expected :(

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

I am not UWP expert. Actually, this plugin is the very first thing i do, so you are free to clone the repo and try to achieve this:

  • Avoid to rebuild multiple times when ResizeChanged is called (maybe resize the each page instead of re-generating them)
  • Use UWP TemplateSelector that will return what Xamarin.Forms template selector will return given the position.

If you take a look at my code, i had to generate all the pages and add them to an array of FrameworkElement and use the array as source of FlipView. That's not the case of iOS and Android where only 3 pages are rendered at a time as maximum. I use each platform widget virtualization in those cases.

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

I think i found the way of not rendering all the views and use a DataTemplate instead, so it will get better in the next version where i will be releasing vertical swiping/scrolling :)

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

If my work is helping you, please help me back: https://xamarinhq.wufoo.com/forms/nominate-a-xamarin-mvp/

from carouselview.

alexrainman avatar alexrainman commented on June 12, 2024

This is what i have done that is community visible:

  • Alex has been pretty active sharing his knowledge and answering questions in StackOverflow, GitHub and Xamarin Forums.
  • Alex has been open sourcing Xamarin components and plugin with the community, with more of 10 repositories being maintained on GitHub.
  • One of Alex's Xamarin.Forms plugin, the CarouselView, is currently being pulled into the Xamarin.Forms core (xamarin/Xamarin.Forms#853). As an stable widget, this control has become the standard for Xamarin.Forms carousel screens with more that 16K downloads in NuGet and more than 100 solved and not open issues.
  • Another Alex's plugin, the SegmentedControl (https://github.com/alexrainman/SegmentedControl), is a big candidate to be also pulled into Xamarin.Forms core.
  • Plus Xamarin.Forms UI related plugins, Alex shares plugins to set app icon Badge, Google Analytics and KeyChain access.
  • Alex shares his knowledge about cutting edge technologies like Couchbase NoSQL and MobileIron integration with Xamarin Apps.

from carouselview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.