public DetailView(int index) { InitializeComponent(); BindingContext = new DetailViewModel(index); var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, e) => { var mainTabbedView = MainTabbedView.FindMainTabbedView(Parent); mainTabbedView.ResetContentView(); }; scrollView.GestureRecognizers.Add(tapGestureRecognizer); }
void CollectionView_SelectionChanged(object sender, SelectionChangedEventArgs e) { var collectionView = (CollectionView)sender; if (!(e.CurrentSelection.FirstOrDefault() is ForecastCell selectedCell)) { return; } var mainTabbedView = MainTabbedView.FindMainTabbedView(Parent); mainTabbedView.SetContentView(new DetailView(selectedCell.Index)); collectionView.SelectedItem = null; }