private void Reset() { _detail = null; _currentPart = null; BangumiPartCollection.Clear(); TagCollection.Clear(); CoinButton.IsCheck = false; TitleBlock.Text = "--"; PlayCountBlock.Text = "-"; DanmukuCountBlock.Text = "-"; CommentButton.Text = "评论"; RepostButton.Text = "-"; BasicInfoBlock.Text = "-"; Section1Title.Text = "--"; Section1Content.Text = "--"; Section2Content.Text = "--"; Section2Title.Text = "--"; DescriptionBlock.Text = "--"; CoverImage.Source = null; ScoreBlock.Text = "--"; ScoreCountBlock.Text = "0人"; RatingContainer.Visibility = Visibility.Visible; Section1Container.Visibility = Visibility.Visible; Section2Container.Visibility = Visibility.Visible; FollowButton.Style = UIHelper.GetStyle("PrimaryAsyncButtonStyle"); FollowButton.Text = "追番"; }
public void Init(string origin, BangumiDetail bangumi, Episode part) { OriginBlock.Text = origin; _tempBangumi = bangumi; _tempPart = part; RepostBox.Text = $"#{bangumi.season_title}# "; RepostBox.Select(RepostBox.Text.Length - 1, 0); }
public void ShowRepostPopup(string origin, BangumiDetail bangumi, Episode part) { if (_repostPopup == null) { _repostPopup = new RepostPopup(); } _repostPopup.ShowPopup(); _repostPopup.Init(origin, bangumi, part); }
public void HidePopup() { _tempTopic = null; _tempVideo = null; _tempBangumi = null; _tempPart = null; RepostBox.Text = string.Empty; OriginBlock.Text = string.Empty; AtUserCollection.Clear(); AtUserCollection.Add(new Owner()); SearchCollection.Clear(); UserSearchBox.Text = string.Empty; PopupOut.Begin(); PopupOut.Completed -= PopupOut_Completed; PopupOut.Completed += PopupOut_Completed; }
public async Task Refresh() { Reset(); var tip = new WaitingPopup("加载视频中..."); tip.ShowPopup(); var detail = await _animeService.GetBangumiDetailAsync(bangumiId, isEp); if (detail != null && detail.season_id > 0) { _detail = detail; CheckCoin(); if (await InitDetail()) { await VideoPlayer.Init(_detail, _currentPart); } } tip.HidePopup(); App.AppViewModel.CurrentPagePanel.PageScrollViewer.ChangeView(0, 0, 1); }
/// <summary> /// 在新窗口中播放视频 /// </summary> /// <param name="bangumi">视频ID</param> /// <param name="cid">分片ID</param> public async void PlayVideoSeparate(BangumiDetail bangumi, Episode part) { CoreApplicationView newView = CoreApplication.CreateNewView(); int newViewId = 0; await newView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Frame frame = new Frame(); frame.Navigate(typeof(MiniPlayerPage), new Tuple <BangumiDetail, Episode>(bangumi, part)); Window.Current.Content = frame; // You have to activate the window in order to show it later. Window.Current.Activate(); newViewId = ApplicationView.GetForCurrentView().Id; }); bool viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newViewId); if (!App._isTabletMode && CurrentPageType == typeof(BangumiPage)) { CurrentPagePanel.MainPageBack(); } }
private void Reset() { _detail = null; _currentPart = null; BangumiPartCollection.Clear(); TagCollection.Clear(); //CoinButton.IsCheck = false; //TitleBlock.Text = "--"; //PlayCountBlock.Text = "-"; //DanmakuCountBlock.Text = "-"; //CommentButton.Text = "-"; //RepostButton.Text = "-"; //BasicInfoBlock.Text = "-"; //DescriptionBlock.Text = "--"; //ScoreBlock.Text = "--"; //ScoreCountBlock.Text = "0人"; //RatingContainer.Visibility = Visibility.Visible; //FollowButton.Style = UIHelper.GetStyle("PrimaryAsyncButtonStyle"); //FollowButton.Text = "追番"; }
public async Task <bool> Init(BangumiDetail detail, int partId) { Reset(); //App.AppViewModel.CurrentPlayerType = Models.Enums.PlayerType.Bangumi; //App.AppViewModel.CurrentVideoPlayer = VideoPlayer; //_detail = detail; //TitleBlock.Text = _detail.title; //PlayCountBlock.Text = _detail.stat.play; //TabletMainPage.Current.SetBackgroundImage(_detail.square_cover ?? _detail.cover); //DanmakuCountBlock.Text = AppTool.GetNumberAbbreviation(_detail.stat.danmakus); //RepostButton.Text = AppTool.GetNumberAbbreviation(_detail.stat.share); //CommentButton.Text = AppTool.GetNumberAbbreviation(_detail.stat.reply); //DescriptionBlock.Text = _detail.evaluate; //ToolTipService.SetToolTip(DescriptionBlock, _detail.evaluate); //if (_detail.rating != null) //{ // ScoreBlock.Text = _detail.rating.score.ToString(); // ScoreCountBlock.Text = AppTool.GetNumberAbbreviation(_detail.rating.count) + "人"; //} //else // RatingContainer.Visibility = Visibility.Collapsed; //BasicInfoBlock.Text = $"{_detail.type_desc}\n{_detail.publish.release_date_show}\n{_detail.publish.time_length_show}"; //CoinButton.Text = AppTool.GetNumberAbbreviation(_detail.stat.coins); //if(_detail.episodes!=null && _detail.episodes.Count > 0) //{ // PartGridView.Visibility = Visibility.Visible; // _detail.episodes.ForEach(p => BangumiPartCollection.Add(p)); //} //else //{ // PartGridView.Visibility = Visibility.Collapsed; //} //if (isEp) //{ // for (int i = 0; i < _detail.episodes.Count; i++) // { // var part = _detail.episodes[i]; // if (part.id == bangumiId) // { // _currentPart = part; // PartGridView.SelectedIndex = i; // PartGridView.ScrollIntoView(part, ScrollIntoViewAlignment.Leading); // break; // } // } // bangumiId = _detail.season_id; //} //else if (_detail.user_status.progress != null) //{ // _currentPart = _detail.episodes.Where(p => p.id == _detail.user_status.progress.last_ep_id).FirstOrDefault(); // if (_currentPart != null) // { // int lastIndex = _detail.episodes.IndexOf(_currentPart); // PartGridView.SelectedIndex = lastIndex - 1 < -1 ? -1 : lastIndex; // PartGridView.ScrollIntoView(_currentPart, ScrollIntoViewAlignment.Leading); // } //} //if (_currentPart == null && _detail.episodes.Count > 0) //{ // _currentPart = _detail.episodes.First(); // PartGridView.SelectedIndex = 0; //} //if (_detail.styles != null && _detail.styles.Count > 0) //{ // TagGridView.Visibility = Visibility.Visible; // _detail.styles.ForEach(p => TagCollection.Add(p)); //} //else //{ // TagGridView.Visibility = Visibility.Collapsed; //} //CheckFollowButton(); //if (_detail.limit != null) //{ // await new ConfirmDialog(_detail.limit.content).ShowAsync(); // return false; //} //await VideoPlayer.Init(_detail, _currentPart); return(true); }