Esempio n. 1
0
 private static void NotifyActiveViewsNavigatingFrom(INavigationContext navigationContext, object[] activeViews)
 {
     foreach (var item in activeViews)
     {
         MvvmHelpers.OnNavigatedFrom(item, navigationContext);
     }
 }
Esempio n. 2
0
            private void OnCurrentItemChanged(object sender, CurrentItemChangedEventArgs e)
            {
                if (sender is CarouselView carousel && carousel.CurrentItem != CurrentView && carousel.CurrentItem != null && carousel.CurrentItem is VisualElement newActiveView)
                {
                    var previousView = CurrentView;
                    CurrentView = newActiveView;

                    if (!_region.ActiveViews.Contains(newActiveView))
                    {
                        _region.Activate(newActiveView);
                    }

                    var info    = PageNavigationRegistry.GetPageNavigationInfo(newActiveView.GetType());
                    var context = new NavigationContext(_region.NavigationService, new Uri(info.Name, UriKind.RelativeOrAbsolute));

                    MvvmHelpers.OnNavigatedFrom(previousView, context);
                    MvvmHelpers.OnNavigatedTo(newActiveView, context);
                }
            }