void TabViewSelectionChanged(object e)
        {
            var s = e as Syncfusion.XForms.TabView.SelectionChangedEventArgs;

            IsAllLoad       = false;
            SearchResult    = null;
            SearchAllResult = null;
            switch (s.Name)
            {
            case "单曲":
                currentType = CloudMusicSearchType.SingleSong;
                break;

            case "综合":
                currentType = CloudMusicSearchType.All;
                break;

            case "视频":
                currentType = CloudMusicSearchType.Video;
                break;

            case "歌手":
                currentType = CloudMusicSearchType.Singer;
                break;

            case "专辑":
                currentType = CloudMusicSearchType.Album;
                break;

            case "歌单":
                currentType = CloudMusicSearchType.PlayList;
                break;

            case "主播电台":
                currentType = CloudMusicSearchType.FM;
                break;

            case "用户":
                currentType = CloudMusicSearchType.User;
                break;

            case "MV":
                currentType = CloudMusicSearchType.MV;
                break;
            }
            if (!string.IsNullOrWhiteSpace(KeyWords))
            {
                if (currentType == CloudMusicSearchType.All)
                {
                    SearchAll();
                }
                else
                {
                    Search();
                }
            }
        }
 public SearchMusicPageViewModel(INavigationService navigationService) : base(navigationService)
 {
     currentType      = CloudMusicSearchType.SingleSong;
     KeyWordsChanged += GetSuggest;
     AutoCompleteSelectionChangedCommand = new Command <object>(AutoCompleteSelectionChanged);
     AutoCompletedCommand             = new Command(AutoCompleted);;
     ListViewItemTappedCommand        = new Command <object>(ListViewItemTappedAsync);
     ListViewItemAppearingCommand     = new Command <object>(ListViewItemAppearing);
     TabViewSelectionChangedCommand   = new Command <object>(TabViewSelectionChanged);
     PlayListItemTappedCommand        = new Command <object>(PlayListItemTapped);
     ArtistsListViewItemTappedCommand = new Command <object>(ArtistsListViewItemTappedAsync);
 }
Ejemplo n.º 3
0
        public static MusicSearchModel Search(string keywords, int limit, int offset, CloudMusicSearchType type)
        {
            if (limit == 0)
            {
                limit = 30;
            }
            string param = string.Format("/search?keywords={0}&limit={1}&offset={2}&type={3}", keywords, limit, offset, (int)type);

            return(ApiGet <MusicSearchModel>(param));
        }