public MarvellousViewModel(ILoggerFacade logger, IUnityContainer container)
        {
            _logger = logger;

            _container = container;
            //命令初始化
            TabChangedCommand = new RelayCommand <string>((str) =>
            {
                switch (str)
                {
                case "精选":
                    CurrentControl = _selectiveView;
                    break;

                case "排行":
                    CurrentControl = _rankingView;
                    break;

                case "歌单":
                    CurrentControl = _songSheetView;
                    break;

                default:
                    break;
                }
            });
            //页面初始化
            _selectiveView = _container.Resolve <View.MoreViews.SelectiveView>();
            _rankingView   = _container.Resolve <RankingView>();
            _songSheetView = _container.Resolve <SongSheetView>();
            //默认当前页
            CurrentControl = _selectiveView;
            //实例化songApi
            SongApi songApi    = _container.Resolve <SongApi>();
            Action  initAction = new Action(songApi.InitAllList);

            initAction.BeginInvoke((ar =>
            {
                CoverSongs = songApi.GetCover();
                foreach (var coverSong in CoverSongs)
                {
                    coverSong.Album.GetAllInfor.BeginInvoke(string.Empty, null, null);
                }
            }), null);

            _logger.Log("精彩ViewModel构造", Category.Debug, Priority.Low);
        }
示例#2
0
        static void Main(string[] args)
        {
            //IndexData data=new IndexData();
            //data.GetIndexData();
            var dsdasdas = MusicApi.GetIndexList();
            var fdf      = HttpClientHelper.GetAsync(dsdasdas).Result;
            var resss    = SearchApi.GetKeySuggest("李");
            var str      = MusicApi.GetKeySuggesUrl("修炼爱情");
            var ss       = HttpClientHelper.GetAsync(str).Result;
            var swe      = MusicApi.GetHotKey();
            var sdsad    = HttpClientHelper.GetAsync(swe).Result;
            var sds      = AlbumApi.InitBriefInfoAlbumAsync("2265047").Result;
            //var sss =
            //    MusicApi.GetSingerAlbum("000GGDys0yA0Nk", 0, 10);
            var     bir     = ImageHelper.DownAsync("http://y.gtimg.cn/music/photo_new/T002R500x500M000004Z9rf305fzyj.jpg").Result;
            SongApi songApi = new SongApi();

            songApi.InitAllListAsync().Wait();
            var lis = songApi.GetCover();

            foreach (var song in lis)
            {
                song.Album.GetAllInfor.BeginInvoke(string.Empty, null, null);
            }
            TopList top = new TopList();

            top.InitFromJsonAsync(4, 0, 10).Wait();
            var sss = MusicApi.GetTopList(4, 0, 30);

            var ssss = HttpClientHelper.GetAsync(sss).Result;

            JObject json = JObject.Parse(ssss);
            var     list = json["songlist"];

            foreach (var VARIABLE in list)
            {
            }

            var s = MusicApi.GetMusicianUrl(1, 200, NetMusic.Mode.MusicianType.cn_man, "L");

            var tt = HttpClientHelper.GetAsync(s).Result;
        }