void BeginLoad() { CurrentOrder = orderBar.SelectOrder; xorderButton.Visibility = System.Windows.Visibility.Visible; xorderButton.Content = orderBar.SelectText; _pageIndex = 1; AllOneRow3ChannelInfos.Clear(); ChannelInfos.Clear(); xLoadChannelsGrid.Visibility = Visibility.Visible; _isLoadingData = true; xLogTextBlock.Text = "加载新的数据 _pageIndex:" + _pageIndex + " 电影个数:" + (_isLongItem == true ? ChannelInfos.Count.ToString() : AllOneRow3ChannelInfos.Count.ToString()); _channelFactory.DownLoadDatas(TypeID, _currentSelectedTagInfos, _pageIndex, _channelItemCount, CurrentOrder); }
protected override void OnBackKeyPress(CancelEventArgs e) { if (gridtools.Visibility == System.Windows.Visibility.Visible) { SetTagsBarStatus(false); SetOrderBarStatus(false); e.Cancel = true; return; } xLoadChannelsGrid.Margin = new Thickness(0, 0, 0, 30); xLoadChannelsGrid.Visibility = Visibility.Visible; xLoadingTextBlock.Text = CommonUtils.LoadingTips; AllOneRow3ChannelInfos.Clear(); ChannelInfos.Clear(); base.OnBackKeyPress(e); }
void BeginGetChannles(bool isReStart) { if (isReStart)//重新加载 { xTypeTitleTextBlock.Text = Enum.GetName(typeof(ChannelTypes), TypeID); AllOneRow3ChannelInfos.Clear(); ChannelInfos.Clear(); if (TypeID == (int)ChannelTypes.VIP尊享) { xTypeTitleTextBlock.Foreground = App.Current.Resources["Orange"] as SolidColorBrush; } if (TypeID == 5 || TypeID == 6 || TypeID == 7) { // 体育 新闻 游戏 xChannelsListBox.ItemTemplate = Resources["LongItemTemplate"] as DataTemplate; xChannelsListBox.ItemsSource = ChannelInfos; _isLongItem = true; } else { xChannelsListBox.ItemTemplate = Resources["SmallItemTemplate"] as DataTemplate; xChannelsListBox.ItemsSource = AllOneRow3ChannelInfos; } _pageIndex = 1; } else//翻页 { _pageIndex++; } int leftCount = _channel_count - (_isLongItem ? ChannelInfos.Count : 3 * AllOneRow3ChannelInfos.Count); if (leftCount > 0 || isReStart) { xLoadChannelsGrid.Visibility = Visibility.Visible; xLoadingTextBlock.Text = (isReStart ? CommonUtils.LoadingTips : "剩余" + leftCount + "部片子"); _isLoadingData = true; xLogTextBlock.Text = "加载新的数据 _pageIndex:" + _pageIndex + " 电影个数:" + (_isLongItem == true ? ChannelInfos.Count.ToString() : AllOneRow3ChannelInfos.Count.ToString()); _channelFactory.DownLoadDatas(TypeID, _currentSelectedTagInfos, _pageIndex, _channelItemCount, CurrentOrder); } }