-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
VMs do not raise navigation methods when used in CarouselView #749
Comments
If I remember correctly the CarouselView is available as separate NuGet and not part of Xamarin.Forms. Check #650 where I think the CarouselView is discussed. |
A CarouselView is not a Page, but rather a control on a Page and therefore will not receive navigation events. |
@adrianknight89 As mentioned CarouselView is part of a separate package so even if it made sense to do something it couldn't be supported in any of the existing packages without creating a new dependency that most people aren't using, and it would have require Prism to be in preview since the CarouselView package is only a preview currently. I'm not going to try to get into good design vs bad design debates here, but note that because the CarouselView is a child element on a page, the CarouselView's children would be sharing the same BindingContext (ViewModel). Assuming you take care of any necessary design issues here, you can accomplish what you're looking for by implementing a behavior for the CarouselView similar to PR #712. Note that all of the events that you would need are specifically tied to the CarouselView and not the ItemsView that it derives from so you would have to implement the behavior for the CarouselView specifically. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm testing out the new XF CarouselView. I wanted to display a content page as a carousel item; however, view models do not raise navigation events.
VM property:
public ObservableCollection<Page> Pages { get; set; }
In VM constructor:
Navigation events are called on the carousel VM but not in each individual page VM. Is this expected behavior or can we improve upon this?
The text was updated successfully, but these errors were encountered: