Example #1
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            TagSuggestionService.IncreaseStateCode(asb);
            base.OnNavigatedTo(e);
            ViewModel = WatchedVM.GetVM(e.Parameter?.ToString());
            ViewModel.SetQueryWithSearchResult();
            ViewModel.Search.Executed += Search_Executed;
            await Dispatcher.YieldIdle();

            var btnExpandButton = ab.Descendants <Button>("ExpandButton").FirstOrDefault();

            if (e.NavigationMode == NavigationMode.New)
            {
                if (e.Parameter != null) // for the pre-load page
                {
                    ViewModel.SearchResult.Reset();
                }

                btnExpandButton?.Focus(FocusState.Programmatic);
            }
            else if (e.NavigationMode == NavigationMode.Back)
            {
                if (!await ViewHelper.ScrollAndFocus(lv, ViewModel.SelectedGallery))
                {
                    btnExpandButton?.Focus(FocusState.Programmatic);
                }
            }
        }
Example #2
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            TagSuggestionService.IncreaseStateCode(asb);
            Navigator.GetForCurrentView().Handlers.Add(this);
            base.OnNavigatedTo(e);
            ViewModel = FavoritesVM.GetVM(e.Parameter?.ToString());
            ViewModel.SetQueryWithSearchResult();
            ViewModel.Search.Executed += Search_Executed;
            await Dispatcher.YieldIdle();

            if (e.NavigationMode == NavigationMode.New)
            {
                if (e.Parameter != null)
                {
                    ViewModel.SearchResult.Reset();
                }

                cbCategory.Focus(FocusState.Programmatic);
            }
            else if (e.NavigationMode == NavigationMode.Back)
            {
                if (!await ViewHelper.ScrollAndFocus(lv, ViewModel.SelectedGallery))
                {
                    cbCategory.Focus(FocusState.Programmatic);
                }
            }
        }
Example #3
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            TagSuggestionService.IncreaseStateCode(this.asb);
            base.OnNavigatedTo(e);
            this.ViewModel = SearchVM.GetVM(e.Parameter?.ToString());
            this.ViewModel.SetQueryWithSearchResult();
            this.ViewModel.Search.Executed += this.Search_Executed;
            await Dispatcher.YieldIdle();

            if (e.NavigationMode == NavigationMode.New)
            {
                if (e.Parameter != null) // for the pre-load page
                {
                    this.ViewModel.SearchResult.Reset();
                }

                this.btnExpandButton?.Focus(FocusState.Programmatic);
            }
            else if (e.NavigationMode == NavigationMode.Back)
            {
                if (!await ViewHelper.ScrollAndFocus(this.lv, this.ViewModel.SelectedGallery))
                {
                    this.btnExpandButton?.Focus(FocusState.Programmatic);
                }
            }
        }