Ejemplo n.º 1
0
        public FirstPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;

            ChannelTypeFactory.Instance.HttpFailorTimeOut += http_FailorTimeOut;
            this.DefaultViewModel["ChannelTypes"] = ChannelTypeFactory.Instance.SelectedViewModel;

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

            _recommendNavFactory = new RecommendNavFactory();
            _recommendNavFactory.HttpSucessHandler += recommandNav_Successed;
            _recommendNavFactory.HttpFailorTimeOut += http_FailorTimeOut;

            LocalRecentFactory.Instance.LocalChangeAction += LoadRecentDatas;
            LocalFavoritesFactory.Instance.LocalChangeAction += LoadFavDatas;

            _cloudRecentGetFactory = new CloudGetFactory();
            _cloudRecentGetFactory.HttpSucessHandler += cloudRecentGetFactory_HttpSucess;

            _cloudFavolitenGetFactory = new CloudGetFactory();
            _cloudFavolitenGetFactory.HttpSucessHandler += cloudFavolitenGetFactory_HttpSucess;

            var colCount = ScreenUtils.CreateColNum(160, 255);
            _recCount = colCount * 3;
            var channelTypeHeight = (180 * colCount) + 50;
            ChannelTypeFactory.Instance.ColNumber = channelTypeHeight / 130;
            channelTypeGridView.MaxHeight = channelTypeHeight;

            slidesShowControl.Init(http_FailorTimeOut);
        }
Ejemplo n.º 2
0
        public FirstPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;

            ChannelTypeFactory.Instance.HttpFailorTimeOut += http_FailorTimeOut;
            this.DefaultViewModel["ChannelTypes"]          = ChannelTypeFactory.Instance.SelectedViewModel;

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

            _recommendNavFactory = new RecommendNavFactory();
            _recommendNavFactory.HttpSucessHandler += recommandNav_Successed;
            _recommendNavFactory.HttpFailorTimeOut += http_FailorTimeOut;

            LocalRecentFactory.Instance.LocalChangeAction    += LoadRecentDatas;
            LocalFavoritesFactory.Instance.LocalChangeAction += LoadFavDatas;

            _cloudRecentGetFactory = new CloudGetFactory();
            _cloudRecentGetFactory.HttpSucessHandler += cloudRecentGetFactory_HttpSucess;

            _cloudFavolitenGetFactory = new CloudGetFactory();
            _cloudFavolitenGetFactory.HttpSucessHandler += cloudFavolitenGetFactory_HttpSucess;

            var colCount = ScreenUtils.CreateColNum(160, 255);

            _recCount = colCount * 3;
            var channelTypeHeight = (180 * colCount) + 50;

            ChannelTypeFactory.Instance.ColNumber = channelTypeHeight / 130;
            channelTypeGridView.MaxHeight         = channelTypeHeight;

            slidesShowControl.Init(http_FailorTimeOut);
        }
Ejemplo n.º 3
0
        public FirstPage()
        {
            InitializeComponent();

            _callbacks = new Dictionary<object, PivotCallbacks>(4);
            _callbacks[recommendPivotItem] = new PivotCallbacks
            {
                Init = RecommendPivotItemBarInit,
                OnActivated = RecommendPivotItemBarActive
            };
            _callbacks[typePivotItem] = new PivotCallbacks
            {
                Init = TypePivotItemInit,
                OnActivated = TypePivotItemActive,
                OnBackKeyPress = TypePivotItemBackPress
            };
            _callbacks[personPivotItem] = new PivotCallbacks 
            {
                OnActivated = personPivotItemActive
            };

            foreach (var callbacks in _callbacks.Values)
            {
                if (callbacks.Init != null)
                {
                    callbacks.Init();
                }
            }

            TiltEffect.TiltableItems.Add(typeof(SlidesShowControl));
            TiltEffect.TiltableItems.Add(typeof(LoginControl));

            _recCount = 9;
            _recommendChannelViewModel = new ChannelRecommendViewModel();

            _recommendNavFactory = new RecommendNavFactory();
            _recommendNavFactory.HttpSucessHandler += recommandNav_Successed;
            _recommendNavFactory.HttpFailorTimeOut += http_FailorTimeOut;

            _cloudRecentGetFactory = new CloudGetFactory();
            _cloudRecentGetFactory.HttpSucessHandler += cloudRecentGetFactory_HttpSucess;

            _cloudFavolitenGetFactory = new CloudGetFactory();
            _cloudFavolitenGetFactory.HttpSucessHandler += cloudFavolitenGetFactory_HttpSucess;

            recommendList.ItemsSource = _recommendChannelViewModel;
            typeList.ItemsSource = ChannelTypeFactory.Instance.SelectedViewModel;
            personalList.ItemsSource = ChannelTypeFactory.Instance.LocalTypes;
            ChannelTypeFactory.Instance.HttpFailorTimeOut += http_FailorTimeOut;
            LoginPage.LoginSucessHandler = LoginSucess_Handler;
        }
Ejemplo n.º 4
0
        public FirstPage()
        {
            InitializeComponent();

            _callbacks = new Dictionary <object, PivotCallbacks>(4);
            _callbacks[recommendPivotItem] = new PivotCallbacks
            {
                Init        = RecommendPivotItemBarInit,
                OnActivated = RecommendPivotItemBarActive
            };
            _callbacks[typePivotItem] = new PivotCallbacks
            {
                Init           = TypePivotItemInit,
                OnActivated    = TypePivotItemActive,
                OnBackKeyPress = TypePivotItemBackPress
            };
            _callbacks[personPivotItem] = new PivotCallbacks
            {
                OnActivated = personPivotItemActive
            };

            foreach (var callbacks in _callbacks.Values)
            {
                if (callbacks.Init != null)
                {
                    callbacks.Init();
                }
            }

            TiltEffect.TiltableItems.Add(typeof(SlidesShowControl));
            TiltEffect.TiltableItems.Add(typeof(LoginControl));

            _recCount = 9;
            _recommendChannelViewModel = new ChannelRecommendViewModel();

            _recommendNavFactory = new RecommendNavFactory();
            _recommendNavFactory.HttpSucessHandler += recommandNav_Successed;
            _recommendNavFactory.HttpFailorTimeOut += http_FailorTimeOut;

            _cloudRecentGetFactory = new CloudGetFactory();
            _cloudRecentGetFactory.HttpSucessHandler += cloudRecentGetFactory_HttpSucess;

            _cloudFavolitenGetFactory = new CloudGetFactory();
            _cloudFavolitenGetFactory.HttpSucessHandler += cloudFavolitenGetFactory_HttpSucess;

            recommendList.ItemsSource = _recommendChannelViewModel;
            typeList.ItemsSource      = ChannelTypeFactory.Instance.SelectedViewModel;
            personalList.ItemsSource  = ChannelTypeFactory.Instance.LocalTypes;
            ChannelTypeFactory.Instance.HttpFailorTimeOut += http_FailorTimeOut;
            LoginPage.LoginSucessHandler = LoginSucess_Handler;
        }
Ejemplo n.º 5
0
        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);
        }
        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);
        }
        public ChannelRecommendPage()
        {
            InitializeComponent();
            this.Loaded += ChannelRecommendPage_Loaded;

            _coverNavFactory = new CoverNavFactory();
            _coverNavFactory.HttpSucessHandler += coverNav_Successed;
            _coverNavFactory.HttpFailorTimeOut += http_FailorTimeOut;

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

            _coverViewModel            = new ChannelCoverViewModel();
            _recommendChannelViewModel = new ChannelRecommendViewModel();

            coverList.ItemsSource = _coverViewModel;

            var navs = FirstPage.RecommandNavs;

            if (navs != null)
            {
                foreach (var nav in navs)
                {
                    var item = new PivotItem();
                    var head = new TextBlock();
                    head.Text  = nav.Name;
                    head.Tag   = nav.Navid;
                    head.Style = App.Current.Resources["PivotMasterTitleStyle"] as Style;
                    var content = new LongListSelector();
                    content.Style             = App.Current.Resources["PivotListStyle"] as Style;
                    content.ItemTemplate      = App.Current.Resources["CoverRecommendTemplate"] as DataTemplate;
                    content.ItemsSource       = _recommendChannelViewModel;
                    content.SelectionChanged += recommend_SelectionChanged;
                    TiltEffect.SetIsTiltEnabled(content, true);
                    item.Header  = head;
                    item.Content = content;
                    recommendPivot.Items.Add(item);
                }
            }
        }
Ejemplo n.º 8
0
        public ChannelRecommendPage()
        {
            InitializeComponent();
            this.Loaded += ChannelRecommendPage_Loaded;

            _coverNavFactory = new CoverNavFactory();
            _coverNavFactory.HttpSucessHandler += coverNav_Successed;
            _coverNavFactory.HttpFailorTimeOut += http_FailorTimeOut;

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

            _coverViewModel = new ChannelCoverViewModel();
            _recommendChannelViewModel = new ChannelRecommendViewModel();

            coverList.ItemsSource = _coverViewModel;

            var navs = FirstPage.RecommandNavs;
            if (navs != null)
            {
                foreach (var nav in navs)
                {
                    var item = new PivotItem();
                    var head = new TextBlock();
                    head.Text = nav.Name;
                    head.Tag = nav.Navid;
                    head.Style = App.Current.Resources["PivotMasterTitleStyle"] as Style;
                    var content = new LongListSelector();
                    content.Style = App.Current.Resources["PivotListStyle"] as Style;
                    content.ItemTemplate = App.Current.Resources["CoverRecommendTemplate"] as DataTemplate;
                    content.ItemsSource = _recommendChannelViewModel;
                    content.SelectionChanged += recommend_SelectionChanged;
                    TiltEffect.SetIsTiltEnabled(content, true);
                    item.Header = head;
                    item.Content = content;
                    recommendPivot.Items.Add(item);
                }
            }
        }