Exemple #1
0
        public DownloadPage()
        {
            InitializeComponent();

            downloadingList.ItemsSource = DownloadViewModel.Instance.DownloadingItems;
            downloadedList.ItemsSource = DownloadViewModel.Instance.DownloadedItems;

            _callbacks = new Dictionary<object, PivotCallbacks>(2);
            _callbacks[downloadingPivotItem] = new PivotCallbacks
            {
                OnActivated= DownloadingActive,
                OnBackKeyPress = DownloadingBackPress
            };
            _callbacks[downloadedPivotItem] = new PivotCallbacks
            {
                OnActivated = DownloadedActive,
                OnBackKeyPress = DownloadedBackPress
            };

            _selectBar = new ApplicationBarIconButton();
            _selectBar.IconUri = new Uri("/Images/AppBar/select.png", UriKind.Relative);
            _selectBar.Text = "选择";
            _selectBar.Click += selectBar_Click;

            _deletedBar = new ApplicationBarIconButton();
            _deletedBar.IconUri = new Uri("/Images/AppBar/delete.png", UriKind.Relative);
            _deletedBar.Text = "删除";
            _deletedBar.Click += deletedBar_Click;
        }
        public ChannelTypePage()
        {
            InitializeComponent();

            selectedList.ItemsSource = ChannelTypeFactory.Instance.SelectedViewModel;
            moreList.ItemsSource = ChannelTypeFactory.Instance.AllViewModel[1];

            _callbacks = new Dictionary<object, PivotCallbacks>(2);
            _callbacks[selectedPivotItem] = new PivotCallbacks
            {
                OnActivated = SelectedPivotItemActive,
                OnBackKeyPress = SelectedPivotItemBackPress
            };
            _callbacks[morePivotItem] = new PivotCallbacks
            {
                OnActivated = MorePivotItemActive,
                OnBackKeyPress = MorePivotItemBackPress
            };

            _selectBar = new ApplicationBarIconButton();
            _selectBar.IconUri = new Uri("/Images/AppBar/select.png", UriKind.Relative);
            _selectBar.Text = "选择";
            _selectBar.Click += selectBar_Click;

            _pinBar = new ApplicationBarIconButton();
            _pinBar.IconUri = new Uri("/Images/AppBar/pin.png", UriKind.Relative);
            _pinBar.Text = "固定到首页";
            _pinBar.Click += pinBar_Click;

            _unPinBar = new ApplicationBarIconButton();
            _unPinBar.IconUri = new Uri("/Images/AppBar/unpin.png", UriKind.Relative);
            _unPinBar.Text = "取消固定";
            _unPinBar.Click += unPinBar_Click;
        }
Exemple #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;
        }