Пример #1
0
 private void UpdateSlideShowTimer()
 {
     if (_viewModel?.HeroImageScrollTimer != null)
     {
         if (ActualWidth <= 900 && !_viewModel.HeroImageScrollTimer.IsEnabled)
         {
             _viewModel.StartHeroImageSlideShow();
         }
         else if (ActualWidth > 900 && _viewModel.HeroImageScrollTimer.IsEnabled)
         {
             _viewModel.StopHeroImageSlideShow();
         }
     }
 }
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var loadData = e.NavigationMode != NavigationMode.Back;

            _viewModel  = ServiceLocator.Current.GetInstance <CategoriesViewModel>(loadData);
            DataContext = _viewModel;

            if (loadData)
            {
                await _viewModel.LoadState();
            }

            _viewModel.StartHeroImageSlideShow();
        }