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() { 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; }