Example #1
0
 public void GigglePlaylist()
 {
     DispatchManager.RunOnDispatcher(() =>
     {
         PlaylistTransform.ScaleX = 1.5;
         PlaylistTransform.ScaleY = 1.5;
         AnimationTools.AnimateDouble(PlaylistTransform, "ScaleX", 1.0, 1250, null, false, true);
         AnimationTools.AnimateDouble(PlaylistTransform, "ScaleY", 1.0, 1250, null, false, true);
     });
 }
Example #2
0
        void ForceBindingRefresh()
        {
            DispatchManager.RunOnDispatcher(() =>
            {
                OnCurrentIndexChanged?.Invoke();
                RaisePropertyChanged(nameof(CanGoNext));
                RaisePropertyChanged(nameof(CanGoPrev));
                RaisePropertyChanged(nameof(CurrentEntry));
                RaisePropertyChanged(nameof(CurrentEpisode));

                if (CurrentEpisode != null)
                {
                    CoreTools.UpdateTile(CurrentEpisode);
                }
            });
        }
Example #3
0
        public void RemoveEntry(PlaylistEntry entry)
        {
            DispatchManager.RunOnDispatcher(() =>
            {
                if (entry == null)
                {
                    return;
                }

                var currentEntry  = CurrentEntry;
                var previousIndex = CurrentIndex;

                if (currentEntry == entry)
                {
                    if (previousIndex + 1 < Entries.Count)
                    {
                        currentEntry = Entries[previousIndex + 1];
                    }
                    else if (previousIndex > 0)
                    {
                        currentEntry = Entries[previousIndex - 1];
                    }
                }

                Entries.Remove(entry);

                if (Entries.Count == 0)
                {
                    CurrentIndex = -1;
                }
                else
                {
                    CurrentIndex = Entries.IndexOf(currentEntry);

                    if (previousIndex == CurrentIndex)
                    {
                        ForceBindingRefresh();
                    }
                }
            });
        }