Ejemplo n.º 1
0
        private void ViewModelOnScrollRequest(AnimeItemViewModel item, bool select = false)
        {
            switch (ViewModel.DisplayMode)
            {
            case AnimeListDisplayModes.IndefiniteCompactList:
                AnimeCompactItemsIndefinite.ScrollIntoView(item);
                if (select)
                {
                    AnimeCompactItemsIndefinite.SelectedItem = item;
                    AnimeCompactItemsIndefinite.Focus(FocusState.Pointer);
                }
                break;

            case AnimeListDisplayModes.IndefiniteList:
                AnimesItemsIndefinite.ScrollIntoView(item);
                if (select)
                {
                    AnimesItemsIndefinite.SelectedItem = item;
                    AnimesItemsIndefinite.Focus(FocusState.Pointer);
                }
                break;

            case AnimeListDisplayModes.IndefiniteGrid:
                AnimesGridIndefinite.ScrollIntoView(item);
                if (select)
                {
                    AnimesGridIndefinite.SelectedItem = item;
                    AnimesGridIndefinite.Focus(FocusState.Pointer);
                }
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 2
0
        private async void AnimesItemsIndefinite_OnItemClick(object sender, ItemClickEventArgs e)
        {
            ViewModel.TemporarilySelectedAnimeItem = e.ClickedItem as AnimeItemViewModel;
            await Task.Delay(50);

            AnimesItemsIndefinite.ScrollIntoView(e.ClickedItem);
        }