private void lbxSongs_LayoutUpdated(object sender, object e)
        {
            if (scrollTo == ScrollToType.No || lbxSongs.Items.Count == 0)
            {
                return;
            }

            ISongCollection songs = Source;

            if (songs == null)
            {
                scrollTo = ScrollToType.No;
                return;
            }

            if (lbxSongs.Items.Count < songs.Shuffle.Count)
            {
                return;
            }

            if (scrollTo == ScrollToType.Current)
            {
                lbxSongs.ScrollIntoView(CurrentSong);
                scrollTo = ScrollToType.No;
            }
            else
            {
                lbxSongs.ScrollIntoView(lbxSongs.Items.Last());
                scrollTo = ScrollToType.Current;
            }
        }
    public void scrollTo(float value, ScrollToType type)
    {
        switch (type)
        {
        case ScrollToType.PIXEL:
            scrollTo(value);
            break;

        case ScrollToType.PERCENT:
            scrollTo(ViewSUI.position.height * value);
            break;
        }
    }
Exemple #3
0
    public void scrollToHorizontal(float value, ScrollToType type)
    {
        switch (type)
        {
        case ScrollToType.PIXEL:
            scrollToHorizontal(value);
            break;

        case ScrollToType.PERCENT:
            scrollToHorizontal(ViewSUI.position.width * value);
            break;
        }
    }
 public void ScrollToCurrentSongTop()
 {
     try
     {
         scrollTo = ScrollToType.Last;
         lbxSongs.ScrollIntoView(lbxSongs.Items.LastOrDefault());
         scrollTo = ScrollToType.Current;
     }
     catch (Exception e)
     {
         MobileDebug.Service.WriteEvent("ScrollToCurrentTopFail", e);
     }
 }
 private void control_Loaded(object sender, RoutedEventArgs e)
 {
     scrollTo = ScrollToType.Last;
 }