Example #1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.NavigationMode != NavigationMode.Back)
            {
                _tagIndex = 0;
                tagBar.Clear();
                _typeItem = (ChannelTypeItem)e.Parameter;

                vodTitle.Text = _typeItem.TypeName;
                var itemWidth  = ChannelTypeFactory.Instance.GetItemWidth(_typeItem.TypeName);
                var itemHeight = ChannelTypeFactory.Instance.GetItemHeight(_typeItem.TypeName);
                _groupNmu   = ScreenUtils.CreateColNum(itemHeight) * 3;
                _requestNum = ScreenUtils.CreateGroupRequestNum(itemWidth, itemHeight, 3);

                LoadDatas(true);
            }
        }
        public ChannelRecommendPage()
        {
            this.InitializeComponent();
            this.Loaded += ChannelRecommendPage_Loaded;
            recommendListListView.LayoutUpdated += ChannelRecommendPage_Loaded;
            this.NavigationCacheMode             = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;

            _recommendChannelFactory = new RecommendListFactory();
            _recommendChannelFactory.HttpSucessHandler += recommendChannelFactory_GetChannelsSucceed;
            _recommendChannelFactory.HttpFailorTimeOut += http_FailorTimeOut;

            _recommendViewModel        = new ChannelRecommendViewModel();
            _recommendViewModel.Groups = new ObservableCollection <ChannelRecommendGroup>();
            this.DefaultViewModel["RecommendListSource"] = _recommendViewModel.Groups;

            _groupNum   = ScreenUtils.CreateColNum(160) * 2;
            _requestNum = ScreenUtils.CreateGroupRequestNum(372, 160, 2);
        }