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); }
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); }
private void InitVariableNEventHandle() { //升级 _upgradeFactory = new UpgradeFactory(); _upgradeFactory.HttpSucessHandler += OnGetUpgradeInfoSucceeded; _upgradeFactory.HttpFailHandler += OnGetUpgradeInfoFailed; _upgradeFactory.HttpTimeOutHandler += OnGetUpgradedInfoTimeout; //大图的导航 _recommendCoverNavFactory = new RecommandCoverNavFactory(); _recommendCoverNavFactory.HttpFailHandler += _recommendCoverNavFactory_GetRecommendNavFailed; _recommendCoverNavFactory.HttpSucessHandler += _recommendCoverNavFactory_GetRecommendNavSucceed; _recommendCoverNavFactory.HttpTimeOutHandler += _recommendCoverNavFactory_GetRecommendNavTimeout; //影片的导航 _recommendNavFactory = new RecommendNavFactory(); _recommendNavFactory.HttpSucessHandler += OnGetRecommendNavSucceeded; _recommendNavFactory.HttpFailHandler += OnGetRecommendNavFailed; _recommendNavFactory.HttpTimeOutHandler += OnGetRecommendNavTimeout; //下载推荐的影片 _channelFactoryByRecommendNav = new VodRecommandFactory(); _channelFactoryByRecommendNav.HttpSucessHandler += OnGetChannelsByRecommendSucceeded; _channelFactoryByRecommendNav.HttpFailHandler += _channelFactoryByRecommendNav_GetChannelsByRecommendNavFailed; _channelFactoryByRecommendNav.HttpTimeOutHandler += _channelFactoryByRecommendNav_GetChannelsByRecommendNavTimeout; xCoverBar.CoverImagesDownloadCompleted += new CoversBar.DownloadedEventHandler(xCoverBar_CoverImagesDownloadCompleted); xCoverBar.ItemTap += new CoversBar.ImageTapEventHandler(xCoverBar_ItemTap); xHotSearchBar.ItemTap += new HotSearchBar.ImageTapEventHandler(xHotSearchBar_ItemTap); _getDataStatusHelp = new GetDataStatusHelp(); _getDataStatusHelp.DataDownloadFailure += new GetDataStatusHelp.DownloadFailEventHandler(_getDataStatusHelp_DataDownloadFailure); }
public void InitVariableNEventHandle() { if (_recommendNavs.Count == 0) { _recommendNavFactory = new RecommendNavFactory(); _recommendNavFactory.HttpFailHandler += _recommendNavFactory_GetRecommendNavFailed; _recommendNavFactory.HttpSucessHandler += _recommendNavFactory_GetRecommendNavSucceed; _recommendNavFactory.HttpTimeOutHandler += _recommendNavFactory_GetRecommendNavTimeout; _recommendNavFactory.DownLoadDatas(); } }
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; }
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; }