예제 #1
0
        public async void UndoIt(object item)
        {
            try
            {
                PlaylistContentView.ScrollIntoView(item, ScrollIntoViewAlignment.Default);
                PlaylistContentView.UpdateLayout();
                MainPageViewModel.Current.IsPopupActive = false;

                ConnectedAnimation ConnectedAnimation = ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("backwardsAnimation", destinationElement);
                //ConnectedAnimation.Completed += ConnectedAnimation_Completed;
                ConnectedAnimation.Configuration = new DirectConnectedAnimationConfiguration();
                await PlaylistContentView.TryStartConnectedAnimationAsync(ConnectedAnimation, item, "connectedElement");
            }
            catch (Exception)
            {
            }
        }
예제 #2
0
        private void HandleMessengerHelper(MessengerHelper messenger)
        {
            try
            {
                switch (messenger.Action)
                {
                case MessengerAction.ScrollToItem:
                    switch (messenger.Target)
                    {
                    case TargetView.Playlist:
                        if (messenger.Item == null && PlaylistContentView.Items != null)
                        {
                            messenger.Item = PlaylistContentView.Items.FirstOrDefault();
                        }
                        PlaylistContentView.ScrollIntoView(messenger.Item, ScrollIntoViewAlignment.Leading);
                        break;

                    case TargetView.Tracks:
                        if (messenger.Item == null && TracksListView.Items != null)
                        {
                            messenger.Item = TracksListView.Items.FirstOrDefault();
                        }
                        TracksListView.ScrollIntoView(messenger.Item, ScrollIntoViewAlignment.Leading);
                        break;

                    case TargetView.SelectedPlaylist:
                        if (messenger.Item == null && SelectedPlaylistViewExpanded.Items != null)
                        {
                            messenger.Item = SelectedPlaylistViewExpanded.Items.FirstOrDefault();
                        }
                        SelectedPlaylistViewExpanded.ScrollIntoView(messenger.Item, ScrollIntoViewAlignment.Leading);
                        break;

                    case TargetView.Alphabet:
                        PlaylistContentView.ScrollIntoView(messenger.Item, ScrollIntoViewAlignment.Leading);
                        break;
                    }
                    break;
                }
            }
            catch (Exception)
            {
            }
        }