private static async Task <SingleVideoDialogViewModel> InitializeVideoModel(BiliVideoInfo videoInfo)
        {
            var model = new SingleVideoDialogViewModel();

            model.VideoName = videoInfo.Name;
            model.Bv        = videoInfo.Bv;
            model.Cid       = videoInfo.Cid;

            //var stream = await NetHelper.HttpGetStreamAsync(videoInfo.CoverUrl, null, null);
            //var file = await ApplicationData.Current.LocalCacheFolder.CreateFileAsync("videocovercache", CreationCollisionOption.GenerateUniqueName);
            //var fileStream = await file.OpenStreamForWriteAsync();
            //await stream.CopyToAsync(fileStream);
            //stream.Close();
            //fileStream.Close();
            //var img = new BitmapImage();
            //await img.SetSourceAsync((await file.OpenStreamForReadAsync()).AsRandomAccessStream());
            var img = new BitmapImage(new Uri(videoInfo.CoverUrl));

            model.VideoCover = img;

            model.VideoQualityList = new List <SingleVideoDialogViewModel.VideoQuality>();
            foreach (var item in videoInfo.QualityCodeList)
            {
                var key   = item;
                var value = QualityDictionary[item];
                model.VideoQualityList.Add(new SingleVideoDialogViewModel.VideoQuality(key, value));
            }

            return(model);
        }
 private SingleVideoDialog(SingleVideoDialogViewModel vm, XamlRoot xamlRoot)
 {
     this.vm          = vm;
     this.DataContext = vm;
     this.InitializeComponent();
     this.Closing += SingleVideoDialog_Closing;
     XamlRoot      = xamlRoot;
 }