Skip to content
Discussion options

You must be logged in to vote
[Obsolete("Obsolete")]
    private void CarouselView_OnCurrentItemChanged(object? sender, CurrentItemChangedEventArgs e)
    {
        _oldMediaElement?.Stop();
        
        if (sender is not CarouselView carouselView) return;
        if (carouselView.VisibleViews.Count < 1) return;
        var view = carouselView.VisibleViews[1];
        var mediaElement = view?.LogicalChildren.FirstOrDefault() as MediaElement;
        mediaElement?.Play();
        _oldMediaElement = mediaElement;
    }
    ```
    
in VisibleViews Collection have 2 Child i just say, i pick the correct child mediaElement and Play it now works.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RedEye-Developers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant