How to use sidebar for changing CarouselView's item position?

Viewed 113

I'm thinking of displaying CarouselView's item names inside sidebar, and when one of the names is clicked, the CarouselView will change its current position, showing that chosen item's details.

The first thing which came into my mind is Shell Flyout's interface which visually fit with what I want, but from the documentation, Flyout is used to for page navigation in Shell.

How can I make this work? If not, is there any good alternative? Thank you.

1 Answers

Here are some functions for a default FlyoutMenu:

public partial class MainPage : FlyoutPage
{
    public MainPage()
    {
        flyoutPage.collectionView.SelectionChanged += OnSelectionChanged;
    }

    void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        //Here you will want to apply the logic for your carousel
        //Will use position as an example
        var item = e.CurrentSelection.FirstOrDefault() as FlyoutPageItem;
        yourCaourselView.Position = 1;
    }
}
Related