Exemple #1
0
        private void BangumiRankView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            CartoonView nv = args.ItemContainer.ContentTemplateRoot as CartoonView;

            if (nv != null)
            {
                if (DiveRect == null || DiveRect.Width <= 0)
                {
                    SetDiveRect();
                }
                nv.Width  = DiveRect.Width / 3 - 25;
                nv.Height = nv.Width * 6 / 3;
                nv.Margin = new Thickness(10, 0, 5, 0);
                nv.AddData(args.Item as AcContent);
            }
        }
Exemple #2
0
        public ActionResult Index()
        {
            int timeOut = 30;

            //首页-收藏 - 推荐位
            var FavRec = DataContext.TryCache <IEnumerable <RecommendView> >("CartoonIndex_Fav", () =>
            {
                return(GetRecList(RecSection.CartoonIndex.FavRec, 3));
            }, timeOut);

            //首页-人气排行
            var HotRec = DataContext.TryCache <IEnumerable <RecommendView> >("CartoonIndex_Pop", () =>
            {
                return(GetRecList(RecSection.CartoonIndex.PopRec, 4));
            }, timeOut);

            //首页-三次元漫画
            var ThreeRec = DataContext.TryCache <IEnumerable <RecommendView> >("CartoonIndex_ThreeD", () =>
            {
                return(GetRecList(RecSection.CartoonIndex.ThreeDRec, 6));
            }, timeOut);

            //首页-顶端广告位
            var headAD = DataContext.TryCache <IEnumerable <AD> >("CartoonIndex_Top", () =>
            {
                return(GetADList(RecSection.CartoonIndex.TopAd, 4));
            }, timeOut);

            //首页-中间广告位
            var middleAD = DataContext.TryCache <IEnumerable <AD> >("CartoonIndex_Middle", () =>
            {
                return(GetADList(RecSection.CartoonIndex.MiddleAd, 1));
            }, timeOut);

            CartoonView index = new CartoonView()
            {
                FavRecList   = new SimpleResponse <IEnumerable <RecommendView> >(!FavRec.IsNullOrEmpty(), FavRec),
                HotRecList   = new SimpleResponse <IEnumerable <RecommendView> >(!HotRec.IsNullOrEmpty(), HotRec),
                ThreeRecList = new SimpleResponse <IEnumerable <RecommendView> >(!ThreeRec.IsNullOrEmpty(), ThreeRec),
                HeadADList   = new SimpleResponse <IEnumerable <AD> >(!headAD.IsNullOrEmpty(), headAD),
                MiddleADList = new SimpleResponse <IEnumerable <AD> >(!middleAD.IsNullOrEmpty(), middleAD)
            };

            return(View(index));
        }
Exemple #3
0
        private void NewBangumiGridView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            CartoonView nv = args.ItemContainer.ContentTemplateRoot as CartoonView;

            if (!CateisTV)
            {
                //var s = NewBangumiGridView.ItemTemplate;
                if (nv != null)
                {
                    if (DiveRect == null || DiveRect.Width <= 0)
                    {
                        SetDiveRect();
                    }
                    nv.Width  = DiveRect.Width / 3 - 25;
                    nv.Height = nv.Width * 6 / 3;
                    nv.Margin = new Thickness(10, 0, 5, 0);
                    nv.AddData(args.Item as AcContent);
                }
            }
            else
            {
                var nov = args.ItemContainer.ContentTemplateRoot as CartoonView;
                if (nov != null)
                {
                    if (DiveRect == null || DiveRect.Width <= 0)
                    {
                        SetDiveRect();
                    }
                    nov.Width  = DiveRect.Width / 3 - 25;
                    nov.Height = nov.Width + 20;
                    nov.Margin = new Thickness(10, 0, 5, 0);
                    //nov.AddAllData(args.Item as AcContent);
                    nov.AddTVData(args.Item as AcContent);
                }
            }
        }