-
Notifications
You must be signed in to change notification settings - Fork 6
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
Port to C# #3
Comments
Hi, i ported this to C# myself and it works. A few things left to the side bacause i'm not an expert on Swift and it seems are not needed on Xamarin ( init(), DMDynamicPageViewControllerDelegate protocol). I still get "Index out of bounds" if i try to delete a Child when List is empty but i can handle that. Here is the link: https://gist.github.com/alexrainman/df03bd8d03a21783237d Take a look, and maybe you can improve it. Thank you! |
Oh, cool! I appreciate that and hope people will find it useful. |
It's very useful as there's not default ViewPager on iOS/Xamarin/C# so, i hope people use it :) |
I should add a README file to the project and include a link to your port so that people are able to find it more easily. If that's OK with you, of course... |
Of course you can :) |
Hi Nik, i made a change to the port. CurrentPage wasn't updating so, i changed ScrollView Scrolled event to this: [Foundation.Export ("scrollViewDidScroll:")]
} By the way, what "index out of bounds" code does? |
Hi Nik, Can you implement it on yours so i can port it to C#? Thanks. |
maybe you can take a look at this: http://stackoverflow.com/questions/14755782/releasing-unused-pages-in-uipageviewcontroller and we can work it out together :) |
That sounds like a nice idea! And you know what's going to be a good way to achieve that? Those "lazy" variables that Swift inherits from functional programming. We can make the viewControllers array generate it's next/previous item "on-demand". That's going to be sweet. However, I'm not sure you will be able to easily port to C#. Does it have similar functionality? |
C# supports Lazy, i don't know if that's the equivalent. Can you give an example? |
I was referring to Swift lazy collections. |
How can i add a listener to this thing so, when i am at the last controller, if i swipe/drag from right to left, load more items? |
Take a look at this, it may help you with the loading and recycling views. The code seems to be complicated comparing with yours: https://github.com/nicklockwood/SwipeView |
I was able to load more with this code: [Foundation.Export ("scrollViewWillBeginDragging:")] [Foundation.Export ("scrollViewDidEndDragging:willDecelerate:")] |
I've pushed some changes in a new branch - dataSourceFeature. It's far from ready, but it outlines my basic idea. |
K, i will take a look, Tanke |
Nik, I added this line of code to your library ViewDidLoad event to solve dragging problem when only 1 view: containerScrollView.AlwaysBounceHorizontal = true; I think we may create this thing inheriting from UIViewPageController that already has the view reusing functionality that we need. You may add your logic to Add/Remove views. What do you think? Tanke. |
Can you do it?
The text was updated successfully, but these errors were encountered: